Chromium Code Reviews| 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 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 152 return expected_import_state; | 152 return expected_import_state; |
| 153 } | 153 } |
| 154 | 154 |
| 155 } // namespace | 155 } // namespace |
| 156 | 156 |
| 157 extern const char kImportDefault[] = | 157 extern const char kImportDefault[] = |
| 158 "{\n" | 158 "{\n" |
| 159 "}\n"; | 159 "}\n"; |
| 160 typedef FirstRunMasterPrefsBrowserTestT<kImportDefault> | 160 typedef FirstRunMasterPrefsBrowserTestT<kImportDefault> |
| 161 FirstRunMasterPrefsImportDefault; | 161 FirstRunMasterPrefsImportDefault; |
| 162 IN_PROC_BROWSER_TEST_F(FirstRunMasterPrefsImportDefault, ImportDefault) { | 162 // http://crbug.com/314221 |
| 163 #if defined(GOOGLE_CHROME_BUILD) && defined(OS_MACOSX) | |
| 164 #define MAYBE_ImportDefault DISABLED_ImportDefault | |
| 165 #else | |
| 166 #define MAYBE_ImportDefault ImportDefault | |
| 167 #endif | |
| 168 IN_PROC_BROWSER_TEST_F(FirstRunMasterPrefsImportDefault, MAYBE_ImportDefault) { | |
| 163 int auto_import_state = first_run::auto_import_state(); | 169 int auto_import_state = first_run::auto_import_state(); |
| 164 EXPECT_EQ(MaskExpectedImportState(first_run::AUTO_IMPORT_CALLED | | 170 EXPECT_EQ(MaskExpectedImportState(first_run::AUTO_IMPORT_CALLED | |
| 165 first_run::AUTO_IMPORT_PROFILE_IMPORTED), | 171 first_run::AUTO_IMPORT_PROFILE_IMPORTED), |
| 166 auto_import_state); | 172 auto_import_state); |
| 167 } | 173 } |
| 168 | 174 |
| 169 // The bookmarks file doesn't actually need to exist for this integration test | 175 // The bookmarks file doesn't actually need to exist for this integration test |
| 170 // to trigger the interaction being tested. | 176 // to trigger the interaction being tested. |
| 171 extern const char kImportBookmarksFile[] = | 177 extern const char kImportBookmarksFile[] = |
| 172 "{\n" | 178 "{\n" |
| 173 " \"distribution\": {\n" | 179 " \"distribution\": {\n" |
| 174 " \"import_bookmarks_from_file\": \"/foo/doesntexists.wtv\"\n" | 180 " \"import_bookmarks_from_file\": \"/foo/doesntexists.wtv\"\n" |
| 175 " }\n" | 181 " }\n" |
| 176 "}\n"; | 182 "}\n"; |
| 177 typedef FirstRunMasterPrefsBrowserTestT<kImportBookmarksFile> | 183 typedef FirstRunMasterPrefsBrowserTestT<kImportBookmarksFile> |
| 178 FirstRunMasterPrefsImportBookmarksFile; | 184 FirstRunMasterPrefsImportBookmarksFile; |
| 185 // http://crbug.com/314221 | |
| 186 #if defined(GOOGLE_CHROME_BUILD) && defined(OS_MACOSX) | |
| 187 #define MAYBE_ImportBookmarksFile DISABLED_ImportBookmarksFile | |
| 188 #else | |
| 189 #define MAYBE_ImportBookmarksFile ImportBookmarksFile | |
| 190 #endif | |
| 179 IN_PROC_BROWSER_TEST_F(FirstRunMasterPrefsImportBookmarksFile, | 191 IN_PROC_BROWSER_TEST_F(FirstRunMasterPrefsImportBookmarksFile, |
| 180 ImportBookmarksFile) { | 192 MAYBE_ImportBookmarksFile) { |
| 181 int auto_import_state = first_run::auto_import_state(); | 193 int auto_import_state = first_run::auto_import_state(); |
| 182 EXPECT_EQ( | 194 EXPECT_EQ( |
| 183 MaskExpectedImportState(first_run::AUTO_IMPORT_CALLED | | 195 MaskExpectedImportState(first_run::AUTO_IMPORT_CALLED | |
| 184 first_run::AUTO_IMPORT_PROFILE_IMPORTED | | 196 first_run::AUTO_IMPORT_PROFILE_IMPORTED | |
| 185 first_run::AUTO_IMPORT_BOOKMARKS_FILE_IMPORTED), | 197 first_run::AUTO_IMPORT_BOOKMARKS_FILE_IMPORTED), |
| 186 auto_import_state); | 198 auto_import_state); |
| 187 } | 199 } |
| 188 | 200 |
| 189 // Test an import with all import options disabled. This is a regression test | 201 // Test an import with all import options disabled. This is a regression test |
| 190 // for http://crbug.com/169984 where this would cause the import process to | 202 // for http://crbug.com/169984 where this would cause the import process to |
| 191 // stay running, and the NTP to be loaded with no apps. | 203 // stay running, and the NTP to be loaded with no apps. |
| 192 extern const char kImportNothing[] = | 204 extern const char kImportNothing[] = |
| 193 "{\n" | 205 "{\n" |
| 194 " \"distribution\": {\n" | 206 " \"distribution\": {\n" |
| 195 " \"import_bookmarks\": false,\n" | 207 " \"import_bookmarks\": false,\n" |
| 196 " \"import_history\": false,\n" | 208 " \"import_history\": false,\n" |
| 197 " \"import_home_page\": false,\n" | 209 " \"import_home_page\": false,\n" |
| 198 " \"import_search_engine\": false\n" | 210 " \"import_search_engine\": false\n" |
| 199 " }\n" | 211 " }\n" |
| 200 "}\n"; | 212 "}\n"; |
| 201 typedef FirstRunMasterPrefsBrowserTestT<kImportNothing> | 213 typedef FirstRunMasterPrefsBrowserTestT<kImportNothing> |
| 202 FirstRunMasterPrefsImportNothing; | 214 FirstRunMasterPrefsImportNothing; |
| 215 // http://crbug.com/314221 | |
| 216 #if defined(GOOGLE_CHROME_BUILD) && defined(OS_MACOSX) | |
| 217 #define MAYBE_ImportNothingAndShowNewTabPage \ | |
| 218 DISABLED_ImportNothingAndShowNewTabPage | |
|
gab
2013/12/03 18:31:55
nit: align DISABLED with MAYBE above.
pshenoy
2013/12/03 19:20:49
I think it should be four space indent.
gab
2013/12/03 19:37:25
Just grep'ed the codebase and it looks like this i
| |
| 219 #else | |
| 220 #define MAYBE_ImportNothingAndShowNewTabPage ImportNothingAndShowNewTabPage | |
| 221 #endif | |
| 203 IN_PROC_BROWSER_TEST_F(FirstRunMasterPrefsImportNothing, | 222 IN_PROC_BROWSER_TEST_F(FirstRunMasterPrefsImportNothing, |
| 204 ImportNothingAndShowNewTabPage) { | 223 MAYBE_ImportNothingAndShowNewTabPage) { |
| 205 EXPECT_EQ(first_run::AUTO_IMPORT_CALLED, first_run::auto_import_state()); | 224 EXPECT_EQ(first_run::AUTO_IMPORT_CALLED, first_run::auto_import_state()); |
| 206 ui_test_utils::NavigateToURLWithDisposition( | 225 ui_test_utils::NavigateToURLWithDisposition( |
| 207 browser(), GURL(chrome::kChromeUINewTabURL), CURRENT_TAB, | 226 browser(), GURL(chrome::kChromeUINewTabURL), CURRENT_TAB, |
| 208 ui_test_utils::BROWSER_TEST_WAIT_FOR_NAVIGATION); | 227 ui_test_utils::BROWSER_TEST_WAIT_FOR_NAVIGATION); |
| 209 content::WebContents* tab = browser()->tab_strip_model()->GetWebContentsAt(0); | 228 content::WebContents* tab = browser()->tab_strip_model()->GetWebContentsAt(0); |
| 210 EXPECT_EQ(1, tab->GetMaxPageID()); | 229 EXPECT_EQ(1, tab->GetMaxPageID()); |
| 211 } | 230 } |
| 212 | 231 |
| 213 #endif // !defined(OS_CHROMEOS) | 232 #endif // !defined(OS_CHROMEOS) |
| OLD | NEW |