Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / chrome / browser / first_run / first_run_browsertest.cc
index c295df9..71dd363 100644 (file)
@@ -83,26 +83,25 @@ class FirstRunMasterPrefsBrowserTestBase : public InProcessBrowserTest {
   FirstRunMasterPrefsBrowserTestBase() {}
 
  protected:
-  virtual void SetUp() OVERRIDE {
+  void SetUp() override {
     // All users of this test class need to call SetMasterPreferencesForTest()
     // before this class' SetUp() is invoked.
     ASSERT_TRUE(text_.get());
 
     ASSERT_TRUE(base::CreateTemporaryFile(&prefs_file_));
-    EXPECT_TRUE(file_util::WriteFile(prefs_file_, text_->c_str(),
-                                     text_->size()));
+    EXPECT_TRUE(base::WriteFile(prefs_file_, text_->c_str(), text_->size()));
     first_run::SetMasterPrefsPathForTesting(prefs_file_);
 
     // This invokes BrowserMain, and does the import, so must be done last.
     InProcessBrowserTest::SetUp();
   }
 
-  virtual void TearDown() OVERRIDE {
+  void TearDown() override {
     EXPECT_TRUE(base::DeleteFile(prefs_file_, false));
     InProcessBrowserTest::TearDown();
   }
 
-  virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE {
+  void SetUpCommandLine(CommandLine* command_line) override {
     InProcessBrowserTest::SetUpCommandLine(command_line);
     command_line->AppendSwitch(switches::kForceFirstRun);
     EXPECT_EQ(first_run::AUTO_IMPORT_NONE, first_run::auto_import_state());
@@ -128,7 +127,7 @@ class FirstRunMasterPrefsBrowserTestT
   FirstRunMasterPrefsBrowserTestT() {}
 
  protected:
-  virtual void SetUp() OVERRIDE {
+  virtual void SetUp() override {
     SetMasterPreferencesForTest(Text);
     FirstRunMasterPrefsBrowserTestBase::SetUp();
   }
@@ -142,9 +141,13 @@ class FirstRunMasterPrefsBrowserTestT
 // bot configurations do not have another profile (browser) to import from and
 // thus the import must not be expected to have occurred.
 int MaskExpectedImportState(int expected_import_state) {
-  scoped_refptr<ImporterList> importer_list(new ImporterList());
-  importer_list->DetectSourceProfilesHack(
-      g_browser_process->GetApplicationLocale(), false);
+  scoped_ptr<ImporterList> importer_list(new ImporterList());
+  base::RunLoop run_loop;
+  importer_list->DetectSourceProfiles(
+      g_browser_process->GetApplicationLocale(),
+      false,  // include_interactive_profiles?
+      run_loop.QuitClosure());
+  run_loop.Run();
   int source_profile_count = importer_list->count();
 #if defined(OS_WIN)
   // On Windows, the importer's DetectIEProfiles() will always add to the count.
@@ -153,7 +156,6 @@ int MaskExpectedImportState(int expected_import_state) {
 #endif
   if (source_profile_count == 0)
     return expected_import_state & ~first_run::AUTO_IMPORT_PROFILE_IMPORTED;
-
   return expected_import_state;
 }
 
@@ -247,7 +249,7 @@ class FirstRunMasterPrefsWithTrackedPreferences
     : public FirstRunMasterPrefsBrowserTestT<kWithTrackedPrefs>,
       public testing::WithParamInterface<std::string> {
  public:
-  virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE {
+  void SetUpCommandLine(CommandLine* command_line) override {
     FirstRunMasterPrefsBrowserTestT::SetUpCommandLine(command_line);
     command_line->AppendSwitchASCII(
         switches::kForceFieldTrials,
@@ -287,8 +289,10 @@ INSTANTIATE_TEST_CASE_P(
     FirstRunMasterPrefsWithTrackedPreferences,
     testing::Values(
         chrome_prefs::internals::kSettingsEnforcementGroupNoEnforcement,
-        chrome_prefs::internals::kSettingsEnforcementGroupEnforceOnload,
-        chrome_prefs::internals::kSettingsEnforcementGroupEnforceAlways));
-
+        chrome_prefs::internals::kSettingsEnforcementGroupEnforceAlways,
+        chrome_prefs::internals::
+            kSettingsEnforcementGroupEnforceAlwaysWithDSE,
+        chrome_prefs::internals::
+            kSettingsEnforcementGroupEnforceAlwaysWithExtensionsAndDSE));
 
 #endif  // !defined(OS_CHROMEOS)