Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6)

Side by Side Diff: chrome/browser/first_run/first_run_browsertest.cc

Issue 22560003: Reland "Add option to import from bookmarks html file to ..."" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: does this fix first run browser_tests for bots? Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 int MaskExpectedImportState(int expected_import_state) { 139 int MaskExpectedImportState(int expected_import_state) {
140 scoped_refptr<ImporterList> importer_list(new ImporterList()); 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 == 1)
gab 2013/09/17 22:06:00 This is wrong, as mentioned in another comment, Au
150 return expected_import_state & ~first_run::AUTO_IMPORT_PROFILE_IMPORTED; 150 return expected_import_state & ~first_run::AUTO_IMPORT_PROFILE_IMPORTED;
151 151
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";
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
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)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698