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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 ASSERT_TRUE(file_util::CreateTemporaryFile(&prefs_file_)); | 86 ASSERT_TRUE(file_util::CreateTemporaryFile(&prefs_file_)); |
87 EXPECT_TRUE(file_util::WriteFile(prefs_file_, text_->c_str(), | 87 EXPECT_TRUE(file_util::WriteFile(prefs_file_, text_->c_str(), |
88 text_->size())); | 88 text_->size())); |
89 first_run::SetMasterPrefsPathForTesting(prefs_file_); | 89 first_run::SetMasterPrefsPathForTesting(prefs_file_); |
90 | 90 |
91 // This invokes BrowserMain, and does the import, so must be done last. | 91 // This invokes BrowserMain, and does the import, so must be done last. |
92 InProcessBrowserTest::SetUp(); | 92 InProcessBrowserTest::SetUp(); |
93 } | 93 } |
94 | 94 |
95 virtual void TearDown() OVERRIDE { | 95 virtual void TearDown() OVERRIDE { |
96 EXPECT_TRUE(base::Delete(prefs_file_, false)); | 96 EXPECT_TRUE(base::DeleteFile(prefs_file_, false)); |
97 InProcessBrowserTest::TearDown(); | 97 InProcessBrowserTest::TearDown(); |
98 } | 98 } |
99 | 99 |
100 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { | 100 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { |
101 InProcessBrowserTest::SetUpCommandLine(command_line); | 101 InProcessBrowserTest::SetUpCommandLine(command_line); |
102 command_line->AppendSwitch(switches::kForceFirstRun); | 102 command_line->AppendSwitch(switches::kForceFirstRun); |
103 EXPECT_EQ(first_run::AUTO_IMPORT_NONE, first_run::auto_import_state()); | 103 EXPECT_EQ(first_run::AUTO_IMPORT_NONE, first_run::auto_import_state()); |
104 | 104 |
105 extensions::ComponentLoader::EnableBackgroundExtensionsForTesting(); | 105 extensions::ComponentLoader::EnableBackgroundExtensionsForTesting(); |
106 } | 106 } |
(...skipping 97 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 |