OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "base/command_line.h" | 5 #include "base/command_line.h" |
6 #include "base/files/file_path.h" | 6 #include "base/files/file_path.h" |
7 #include "base/memory/ref_counted.h" | 7 #include "base/memory/ref_counted.h" |
8 #include "base/prefs/pref_service.h" | 8 #include "base/prefs/pref_service.h" |
9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 | 130 |
131 private: | 131 private: |
132 DISALLOW_COPY_AND_ASSIGN(FirstRunMasterPrefsBrowserTestT); | 132 DISALLOW_COPY_AND_ASSIGN(FirstRunMasterPrefsBrowserTestT); |
133 }; | 133 }; |
134 | 134 |
135 // Returns the true expected import state, derived from the original | 135 // Returns the true expected import state, derived from the original |
136 // |expected_import_state|, for the current test machine's configuration. Some | 136 // |expected_import_state|, for the current test machine's configuration. Some |
137 // bot configurations do not have another profile (browser) to import from and | 137 // bot configurations do not have another profile (browser) to import from and |
138 // thus the import must not be expected to have occurred. | 138 // thus the import must not be expected to have occurred. |
139 int MaskExpectedImportState(int expected_import_state) { | 139 int MaskExpectedImportState(int expected_import_state) { |
140 scoped_refptr<ImporterList> importer_list(new ImporterList(NULL)); | 140 scoped_refptr<ImporterList> importer_list(new ImporterList()); |
141 importer_list->DetectSourceProfilesHack( | 141 importer_list->DetectSourceProfilesHack( |
142 g_browser_process->GetApplicationLocale()); | 142 g_browser_process->GetApplicationLocale()); |
143 int source_profile_count = importer_list->count(); | 143 int source_profile_count = importer_list->count(); |
144 #if defined(OS_WIN) | 144 #if defined(OS_WIN) |
145 // On Windows, the importer's DetectIEProfiles() will always add to the count. | 145 // On Windows, the importer's DetectIEProfiles() will always add to the count. |
146 // Internet Explorer always exists and always has something to import. | 146 // Internet Explorer always exists and always has something to import. |
147 EXPECT_GT(source_profile_count, 0); | 147 EXPECT_GT(source_profile_count, 0); |
148 #endif | 148 #endif |
149 if (source_profile_count == 0) | 149 if (source_profile_count == 0) |
150 return expected_import_state & ~first_run::AUTO_IMPORT_PROFILE_IMPORTED; | 150 return expected_import_state & ~first_run::AUTO_IMPORT_PROFILE_IMPORTED; |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 ImportNothingAndShowNewTabPage) { | 204 ImportNothingAndShowNewTabPage) { |
205 EXPECT_EQ(first_run::AUTO_IMPORT_CALLED, first_run::auto_import_state()); | 205 EXPECT_EQ(first_run::AUTO_IMPORT_CALLED, first_run::auto_import_state()); |
206 ui_test_utils::NavigateToURLWithDisposition( | 206 ui_test_utils::NavigateToURLWithDisposition( |
207 browser(), GURL(chrome::kChromeUINewTabURL), CURRENT_TAB, | 207 browser(), GURL(chrome::kChromeUINewTabURL), CURRENT_TAB, |
208 ui_test_utils::BROWSER_TEST_WAIT_FOR_NAVIGATION); | 208 ui_test_utils::BROWSER_TEST_WAIT_FOR_NAVIGATION); |
209 content::WebContents* tab = browser()->tab_strip_model()->GetWebContentsAt(0); | 209 content::WebContents* tab = browser()->tab_strip_model()->GetWebContentsAt(0); |
210 EXPECT_EQ(1, tab->GetMaxPageID()); | 210 EXPECT_EQ(1, tab->GetMaxPageID()); |
211 } | 211 } |
212 | 212 |
213 #endif // !defined(OS_CHROMEOS) | 213 #endif // !defined(OS_CHROMEOS) |
OLD | NEW |