tests/ceftests/preference_unittest.cc
// Validate getting and setting values.
Validate getting and setting values.
Validate getting and setting values .
void ValidateSetGet(CefRefPtr<CefRequestContext> context,
                    CefRefPtr<CefWaitableEvent> event) {
  if (!CefCurrentlyOn(TID_UI)) {
    CefPostTask(TID_UI, base::BindOnce(ValidateSetGet, context, event));
    return;
  }
  CefRefPtr<CefListValue> list_val = CefListValue::Create();
  CefRefPtr<CefDictionaryValue> dict_val = CefDictionaryValue::Create();
  PopulateListValue(list_val);
  PopulateDictValue(dict_val);
  ValidateBool(context, true, true);
  ValidateInt(context, true, 65);
  ValidateDouble(context, true, 54.5443);
  ValidateString(context, true, "My test string");
  ValidateList(context, true, list_val);
  ValidateDict(context, true, dict_val);
  ValidateNoExist(context, true);
  CefRefPtr<CefDictionaryValue> expected = CefDictionaryValue::Create();
  PopulateRootSet(expected);
  ValidateRoot(context->GetAllPreferences(true), expected);
  ValidateRoot(context->GetAllPreferences(false), expected);
  event->Signal();
}
void ValidateSetGet ( CefRefPtr < CefRequestContext > context , CefRefPtr < CefWaitableEvent > event ) { if ( ! CefCurrentlyOn ( TID_UI ) ) { CefPostTask ( TID_UI , base :: BindOnce ( ValidateSetGet , context , event ) ) ; return ; } CefRefPtr < CefListValue > list_val = CefListValue :: Create ( ) ; CefRefPtr < CefDictionaryValue > dict_val = CefDictionaryValue :: Create ( ) ; PopulateListValue ( list_val ) ; PopulateDictValue ( dict_val ) ; ValidateBool ( context , true , true ) ; ValidateInt ( context , true , 65 ) ; ValidateDouble ( context , true , 54.5443 ) ; ValidateString ( context , true , " " ) ; ValidateList ( context , true , list_val ) ; ValidateDict ( context , true , dict_val ) ; ValidateNoExist ( context , true ) ; CefRefPtr < CefDictionaryValue > expected = CefDictionaryValue :: Create ( ) ; PopulateRootSet ( expected ) ; ValidateRoot ( context -> GetAllPreferences ( true ) , expected ) ; ValidateRoot ( context -> GetAllPreferences ( false ) , expected ) ; event -> Signal ( ) ; }
Validate getting and setting values.
Validate getting and setting values .
// Test setting/getting values. // Should match the values in PopulateRootSet and ValidateGet. // Expected value of the tests root. // Validate all preferences including defaults. // Validate all preferences excluding defaults.