| 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/basictypes.h" | 5 #include "base/basictypes.h" |
| 6 #include "base/command_line.h" | 6 #include "base/command_line.h" |
| 7 #if defined(OS_MACOSX) | 7 #if defined(OS_MACOSX) |
| 8 #include "base/mac/mac_util.h" | 8 #include "base/mac/mac_util.h" |
| 9 #endif | 9 #endif |
| 10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
| 11 #include "base/win/windows_version.h" | 11 #include "base/win/windows_version.h" |
| 12 #include "chrome/browser/extensions/extension_apitest.h" | 12 #include "chrome/browser/extensions/extension_apitest.h" |
| 13 #include "chrome/browser/extensions/extension_service.h" | 13 #include "chrome/browser/extensions/extension_service.h" |
| 14 #include "chrome/browser/extensions/extension_test_message_listener.h" | 14 #include "chrome/browser/extensions/extension_test_message_listener.h" |
| 15 #include "chrome/browser/extensions/tab_helper.h" | 15 #include "chrome/browser/extensions/tab_helper.h" |
| 16 #include "chrome/browser/profiles/profile.h" | 16 #include "chrome/browser/profiles/profile.h" |
| 17 #include "chrome/browser/ui/fullscreen/fullscreen_controller.h" | 17 #include "chrome/browser/ui/fullscreen/fullscreen_controller.h" |
| 18 #include "chrome/common/chrome_switches.h" | 18 #include "chrome/common/chrome_switches.h" |
| 19 #include "chrome/common/chrome_version_info.h" | 19 #include "chrome/common/chrome_version_info.h" |
| 20 #include "chrome/common/extensions/features/base_feature_provider.h" | 20 #include "chrome/common/extensions/features/base_feature_provider.h" |
| 21 #include "chrome/common/extensions/features/complex_feature.h" | 21 #include "chrome/common/extensions/features/complex_feature.h" |
| 22 #include "chrome/common/extensions/features/simple_feature.h" | 22 #include "chrome/common/extensions/features/simple_feature.h" |
| 23 #include "chrome/test/base/test_switches.h" | 23 #include "chrome/test/base/test_switches.h" |
| 24 #include "content/public/browser/render_process_host.h" | 24 #include "content/public/browser/render_process_host.h" |
| 25 #include "content/public/browser/render_view_host.h" | 25 #include "content/public/browser/render_view_host.h" |
| 26 #include "content/public/common/content_switches.h" | 26 #include "content/public/common/content_switches.h" |
| 27 #include "extensions/common/feature_switch.h" | 27 #include "extensions/common/feature_switch.h" |
| 28 #include "extensions/common/features/feature.h" | 28 #include "extensions/common/features/feature.h" |
| 29 #include "extensions/common/switches.h" |
| 29 #include "ui/compositor/compositor_switches.h" | 30 #include "ui/compositor/compositor_switches.h" |
| 30 | 31 |
| 31 namespace { | 32 namespace { |
| 32 | 33 |
| 33 const char kExtensionId[] = "ddchlicdkolnonkihahngkmmmjnjlkkf"; | 34 const char kExtensionId[] = "ddchlicdkolnonkihahngkmmmjnjlkkf"; |
| 34 | 35 |
| 35 class TabCaptureApiTest : public ExtensionApiTest { | 36 class TabCaptureApiTest : public ExtensionApiTest { |
| 36 public: | 37 public: |
| 37 void AddExtensionToCommandLineWhitelist() { | 38 void AddExtensionToCommandLineWhitelist() { |
| 38 CommandLine::ForCurrentProcess()->AppendSwitchASCII( | 39 CommandLine::ForCurrentProcess()->AppendSwitchASCII( |
| 39 switches::kWhitelistedExtensionID, kExtensionId); | 40 extensions::switches::kWhitelistedExtensionID, kExtensionId); |
| 40 } | 41 } |
| 41 }; | 42 }; |
| 42 | 43 |
| 43 class TabCaptureApiPixelTest : public TabCaptureApiTest { | 44 class TabCaptureApiPixelTest : public TabCaptureApiTest { |
| 44 public: | 45 public: |
| 45 virtual void SetUp() OVERRIDE { | 46 virtual void SetUp() OVERRIDE { |
| 46 EnablePixelOutput(); | 47 EnablePixelOutput(); |
| 47 TabCaptureApiTest::SetUp(); | 48 TabCaptureApiTest::SetUp(); |
| 48 } | 49 } |
| 49 }; | 50 }; |
| (...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 289 #if defined(OS_WIN) && !defined(NDEBUG) | 290 #if defined(OS_WIN) && !defined(NDEBUG) |
| 290 #define MAYBE_Constraints DISABLED_Constraints | 291 #define MAYBE_Constraints DISABLED_Constraints |
| 291 #else | 292 #else |
| 292 #define MAYBE_Constraints Constraints | 293 #define MAYBE_Constraints Constraints |
| 293 #endif | 294 #endif |
| 294 IN_PROC_BROWSER_TEST_F(TabCaptureApiTest, MAYBE_Constraints) { | 295 IN_PROC_BROWSER_TEST_F(TabCaptureApiTest, MAYBE_Constraints) { |
| 295 AddExtensionToCommandLineWhitelist(); | 296 AddExtensionToCommandLineWhitelist(); |
| 296 ASSERT_TRUE(RunExtensionSubtest("tab_capture", "constraints.html")) | 297 ASSERT_TRUE(RunExtensionSubtest("tab_capture", "constraints.html")) |
| 297 << message_; | 298 << message_; |
| 298 } | 299 } |
| OLD | NEW |