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