| 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 "chrome/browser/prefs/incognito_mode_prefs.h" | 7 #include "chrome/browser/prefs/incognito_mode_prefs.h" |
| 8 #include "chrome/browser/prefs/pref_service.h" | 8 #include "chrome/browser/prefs/pref_service.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 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 ASSERT_TRUE(RunExtensionSubtest("tabs/capture_visible_tab", | 157 ASSERT_TRUE(RunExtensionSubtest("tabs/capture_visible_tab", |
| 158 "test_file.html")) << message_; | 158 "test_file.html")) << message_; |
| 159 } | 159 } |
| 160 | 160 |
| 161 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, CaptureVisibleNoFile) { | 161 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, CaptureVisibleNoFile) { |
| 162 ASSERT_TRUE(RunExtensionSubtest( | 162 ASSERT_TRUE(RunExtensionSubtest( |
| 163 "tabs/capture_visible_tab", "test_nofile.html", | 163 "tabs/capture_visible_tab", "test_nofile.html", |
| 164 ExtensionApiTest::kFlagNone)) << message_; | 164 ExtensionApiTest::kFlagNone)) << message_; |
| 165 } | 165 } |
| 166 | 166 |
| 167 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, CaptureVisibleDisabled) { |
| 168 browser()->profile()->GetPrefs()->SetBoolean(prefs::kDisableScreenshots, |
| 169 true); |
| 170 ASSERT_TRUE(RunExtensionSubtest("tabs/capture_visible_tab", |
| 171 "test_disabled.html")) << message_; |
| 172 } |
| 173 |
| 167 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, TabsOnUpdated) { | 174 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, TabsOnUpdated) { |
| 168 ASSERT_TRUE(RunExtensionTest("tabs/on_updated")) << message_; | 175 ASSERT_TRUE(RunExtensionTest("tabs/on_updated")) << message_; |
| 169 } | 176 } |
| 170 | 177 |
| 171 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, | 178 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, |
| 172 MAYBE_FocusWindowDoesNotExitFullscreen) { | 179 MAYBE_FocusWindowDoesNotExitFullscreen) { |
| 173 browser()->window()->EnterFullscreen( | 180 browser()->window()->EnterFullscreen( |
| 174 GURL(), FEB_TYPE_BROWSER_FULLSCREEN_EXIT_INSTRUCTION); | 181 GURL(), FEB_TYPE_BROWSER_FULLSCREEN_EXIT_INSTRUCTION); |
| 175 bool is_fullscreen = browser()->window()->IsFullscreen(); | 182 bool is_fullscreen = browser()->window()->IsFullscreen(); |
| 176 ASSERT_TRUE(RunExtensionTest("window_update/focus")) << message_; | 183 ASSERT_TRUE(RunExtensionTest("window_update/focus")) << message_; |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 218 } | 225 } |
| 219 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, DISABLED_GetViewsOfCreatedWindow) { | 226 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, DISABLED_GetViewsOfCreatedWindow) { |
| 220 ASSERT_TRUE(RunExtensionSubtest("tabs/basics", "get_views_window.html")) | 227 ASSERT_TRUE(RunExtensionSubtest("tabs/basics", "get_views_window.html")) |
| 221 << message_; | 228 << message_; |
| 222 } | 229 } |
| 223 | 230 |
| 224 // Adding a new test? Awesome. But API tests are the old hotness. The | 231 // Adding a new test? Awesome. But API tests are the old hotness. The |
| 225 // new hotness is extension_test_utils. See extension_tabs_test.cc for | 232 // new hotness is extension_test_utils. See extension_tabs_test.cc for |
| 226 // an example. We are trying to phase out many uses of API tests as | 233 // an example. We are trying to phase out many uses of API tests as |
| 227 // they tend to be flaky. | 234 // they tend to be flaky. |
| OLD | NEW |