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 "chrome/browser/extensions/extension_apitest.h" | 5 #include "chrome/browser/extensions/extension_apitest.h" |
6 | 6 |
7 #include "base/prefs/pref_service.h" | 7 #include "base/prefs/pref_service.h" |
8 #include "chrome/browser/prefs/incognito_mode_prefs.h" | 8 #include "chrome/browser/prefs/incognito_mode_prefs.h" |
9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
10 #include "chrome/browser/ui/browser.h" | 10 #include "chrome/browser/ui/browser.h" |
(...skipping 20 matching lines...) Expand all Loading... |
31 // http://crbug.com/145639 | 31 // http://crbug.com/145639 |
32 #if defined(OS_LINUX) || defined(OS_WIN) | 32 #if defined(OS_LINUX) || defined(OS_WIN) |
33 #define MAYBE_TabEvents DISABLED_TabEvents | 33 #define MAYBE_TabEvents DISABLED_TabEvents |
34 #else | 34 #else |
35 #define MAYBE_TabEvents TabEvents | 35 #define MAYBE_TabEvents TabEvents |
36 #endif | 36 #endif |
37 | 37 |
38 class ExtensionApiNewTabTest : public ExtensionApiTest { | 38 class ExtensionApiNewTabTest : public ExtensionApiTest { |
39 public: | 39 public: |
40 ExtensionApiNewTabTest() {} | 40 ExtensionApiNewTabTest() {} |
41 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { | 41 virtual void SetUpCommandLine(CommandLine* command_line) override { |
42 ExtensionApiTest::SetUpCommandLine(command_line); | 42 ExtensionApiTest::SetUpCommandLine(command_line); |
43 // Override the default which InProcessBrowserTest adds if it doesn't see a | 43 // Override the default which InProcessBrowserTest adds if it doesn't see a |
44 // homepage. | 44 // homepage. |
45 command_line->AppendSwitchASCII( | 45 command_line->AppendSwitchASCII( |
46 switches::kHomePage, chrome::kChromeUINewTabURL); | 46 switches::kHomePage, chrome::kChromeUINewTabURL); |
47 } | 47 } |
48 }; | 48 }; |
49 | 49 |
50 IN_PROC_BROWSER_TEST_F(ExtensionApiNewTabTest, Tabs) { | 50 IN_PROC_BROWSER_TEST_F(ExtensionApiNewTabTest, Tabs) { |
51 // The test creates a tab and checks that the URL of the new tab | 51 // The test creates a tab and checks that the URL of the new tab |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 } | 153 } |
154 | 154 |
155 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, DISABLED_TabReload) { | 155 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, DISABLED_TabReload) { |
156 ASSERT_TRUE(RunExtensionTest("tabs/reload")) << message_; | 156 ASSERT_TRUE(RunExtensionTest("tabs/reload")) << message_; |
157 } | 157 } |
158 | 158 |
159 class ExtensionApiCaptureTest : public ExtensionApiTest { | 159 class ExtensionApiCaptureTest : public ExtensionApiTest { |
160 public: | 160 public: |
161 ExtensionApiCaptureTest() {} | 161 ExtensionApiCaptureTest() {} |
162 | 162 |
163 virtual void SetUp() OVERRIDE { | 163 virtual void SetUp() override { |
164 EnablePixelOutput(); | 164 EnablePixelOutput(); |
165 ExtensionApiTest::SetUp(); | 165 ExtensionApiTest::SetUp(); |
166 } | 166 } |
167 | 167 |
168 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { | 168 virtual void SetUpCommandLine(CommandLine* command_line) override { |
169 ExtensionApiTest::SetUpCommandLine(command_line); | 169 ExtensionApiTest::SetUpCommandLine(command_line); |
170 } | 170 } |
171 }; | 171 }; |
172 | 172 |
173 IN_PROC_BROWSER_TEST_F(ExtensionApiCaptureTest, | 173 IN_PROC_BROWSER_TEST_F(ExtensionApiCaptureTest, |
174 DISABLED_CaptureVisibleTabJpeg) { | 174 DISABLED_CaptureVisibleTabJpeg) { |
175 host_resolver()->AddRule("a.com", "127.0.0.1"); | 175 host_resolver()->AddRule("a.com", "127.0.0.1"); |
176 host_resolver()->AddRule("b.com", "127.0.0.1"); | 176 host_resolver()->AddRule("b.com", "127.0.0.1"); |
177 ASSERT_TRUE(StartEmbeddedTestServer()); | 177 ASSERT_TRUE(StartEmbeddedTestServer()); |
178 ASSERT_TRUE(RunExtensionSubtest("tabs/capture_visible_tab", | 178 ASSERT_TRUE(RunExtensionSubtest("tabs/capture_visible_tab", |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
250 << message_; | 250 << message_; |
251 } | 251 } |
252 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, DISABLED_GetViewsOfCreatedWindow) { | 252 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, DISABLED_GetViewsOfCreatedWindow) { |
253 ASSERT_TRUE(RunExtensionSubtest("tabs/basics", "get_views_window.html")) | 253 ASSERT_TRUE(RunExtensionSubtest("tabs/basics", "get_views_window.html")) |
254 << message_; | 254 << message_; |
255 } | 255 } |
256 | 256 |
257 // Adding a new test? Awesome. But API tests are the old hotness. The | 257 // Adding a new test? Awesome. But API tests are the old hotness. The |
258 // new hotness is extension_test_utils. See tabs_test.cc for an example. | 258 // new hotness is extension_test_utils. See tabs_test.cc for an example. |
259 // We are trying to phase out many uses of API tests as they tend to be flaky. | 259 // We are trying to phase out many uses of API tests as they tend to be flaky. |
OLD | NEW |