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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 class FirstRunMasterPrefsBrowserTestBase : public InProcessBrowserTest { | 76 class FirstRunMasterPrefsBrowserTestBase : public InProcessBrowserTest { |
77 public: | 77 public: |
78 FirstRunMasterPrefsBrowserTestBase() {} | 78 FirstRunMasterPrefsBrowserTestBase() {} |
79 | 79 |
80 protected: | 80 protected: |
81 virtual void SetUp() OVERRIDE { | 81 virtual void SetUp() OVERRIDE { |
82 // All users of this test class need to call SetMasterPreferencesForTest() | 82 // All users of this test class need to call SetMasterPreferencesForTest() |
83 // before this class' SetUp() is invoked. | 83 // before this class' SetUp() is invoked. |
84 ASSERT_TRUE(text_.get()); | 84 ASSERT_TRUE(text_.get()); |
85 | 85 |
86 ASSERT_TRUE(file_util::CreateTemporaryFile(&prefs_file_)); | 86 ASSERT_TRUE(base::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::DeleteFile(prefs_file_, false)); | 96 EXPECT_TRUE(base::DeleteFile(prefs_file_, false)); |
(...skipping 107 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 |