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 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
192 DISABLED_CaptureVisibleTabRace) { | 192 DISABLED_CaptureVisibleTabRace) { |
193 ASSERT_TRUE(RunExtensionSubtest("tabs/capture_visible_tab", | 193 ASSERT_TRUE(RunExtensionSubtest("tabs/capture_visible_tab", |
194 "test_race.html")) << message_; | 194 "test_race.html")) << message_; |
195 } | 195 } |
196 | 196 |
197 IN_PROC_BROWSER_TEST_F(ExtensionApiCaptureTest, CaptureVisibleFile) { | 197 IN_PROC_BROWSER_TEST_F(ExtensionApiCaptureTest, CaptureVisibleFile) { |
198 ASSERT_TRUE(RunExtensionSubtest("tabs/capture_visible_tab", | 198 ASSERT_TRUE(RunExtensionSubtest("tabs/capture_visible_tab", |
199 "test_file.html")) << message_; | 199 "test_file.html")) << message_; |
200 } | 200 } |
201 | 201 |
202 // Flaky on windows: http://crbug.com/238667 | |
203 #if defined(OS_WIN) | |
204 #define MAYBE_CaptureVisibleNoFile DISABLED_CaptureVisibleNoFile | |
205 #else | |
206 #define MAYBE_CaptureVisibleNoFile CaptureVisibleNoFile | |
207 #endif | |
208 IN_PROC_BROWSER_TEST_F(ExtensionApiCaptureTest, MAYBE_CaptureVisibleNoFile) { | |
209 ASSERT_TRUE(RunExtensionSubtest( | |
210 "tabs/capture_visible_tab", "test_nofile.html", | |
211 ExtensionApiTest::kFlagNone)) << message_; | |
212 } | |
213 | |
214 IN_PROC_BROWSER_TEST_F(ExtensionApiCaptureTest, CaptureVisibleDisabled) { | 202 IN_PROC_BROWSER_TEST_F(ExtensionApiCaptureTest, CaptureVisibleDisabled) { |
215 browser()->profile()->GetPrefs()->SetBoolean(prefs::kDisableScreenshots, | 203 browser()->profile()->GetPrefs()->SetBoolean(prefs::kDisableScreenshots, |
216 true); | 204 true); |
217 ASSERT_TRUE(RunExtensionSubtest("tabs/capture_visible_tab", | 205 ASSERT_TRUE(RunExtensionSubtest("tabs/capture_visible_tab", |
218 "test_disabled.html")) << message_; | 206 "test_disabled.html")) << message_; |
219 } | 207 } |
220 | 208 |
221 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, TabsOnUpdated) { | 209 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, TabsOnUpdated) { |
222 ASSERT_TRUE(RunExtensionTest("tabs/on_updated")) << message_; | 210 ASSERT_TRUE(RunExtensionTest("tabs/on_updated")) << message_; |
223 } | 211 } |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
259 << message_; | 247 << message_; |
260 } | 248 } |
261 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, DISABLED_GetViewsOfCreatedWindow) { | 249 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, DISABLED_GetViewsOfCreatedWindow) { |
262 ASSERT_TRUE(RunExtensionSubtest("tabs/basics", "get_views_window.html")) | 250 ASSERT_TRUE(RunExtensionSubtest("tabs/basics", "get_views_window.html")) |
263 << message_; | 251 << message_; |
264 } | 252 } |
265 | 253 |
266 // Adding a new test? Awesome. But API tests are the old hotness. The | 254 // Adding a new test? Awesome. But API tests are the old hotness. The |
267 // new hotness is extension_test_utils. See tabs_test.cc for an example. | 255 // new hotness is extension_test_utils. See tabs_test.cc for an example. |
268 // We are trying to phase out many uses of API tests as they tend to be flaky. | 256 // We are trying to phase out many uses of API tests as they tend to be flaky. |
OLD | NEW |