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" |
(...skipping 16 matching lines...) Expand all Loading... |
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 "ui/compositor/compositor_switches.h" | 29 #include "ui/compositor/compositor_switches.h" |
30 | 30 |
31 namespace { | 31 namespace { |
32 | 32 |
33 const char kExtensionId[] = "ddchlicdkolnonkihahngkmmmjnjlkkf"; | 33 const char kExtensionId[] = "ddchlicdkolnonkihahngkmmmjnjlkkf"; |
34 | 34 |
35 class TabCaptureApiTest : public ExtensionApiTest { | 35 class TabCaptureApiTest : public ExtensionApiTest { |
36 public: | 36 public: |
37 TabCaptureApiTest() {} | |
38 | |
39 virtual void SetUp() OVERRIDE { | |
40 // TODO(danakj): The GPU Video Decoder needs real GL bindings. | |
41 // crbug.com/269087 | |
42 UseRealGLBindings(); | |
43 | |
44 // These test should be using OSMesa on CrOS, which would make this | |
45 // unneeded. | |
46 // crbug.com/313128 | |
47 #if !defined(OS_CHROMEOS) | |
48 UseRealGLContexts(); | |
49 #endif | |
50 | |
51 ExtensionApiTest::SetUp(); | |
52 } | |
53 | |
54 void AddExtensionToCommandLineWhitelist() { | 37 void AddExtensionToCommandLineWhitelist() { |
55 CommandLine::ForCurrentProcess()->AppendSwitchASCII( | 38 CommandLine::ForCurrentProcess()->AppendSwitchASCII( |
56 switches::kWhitelistedExtensionID, kExtensionId); | 39 switches::kWhitelistedExtensionID, kExtensionId); |
57 } | 40 } |
58 }; | 41 }; |
59 | 42 |
| 43 class TabCaptureApiPixelTest : public TabCaptureApiTest { |
| 44 public: |
| 45 virtual void SetUp() OVERRIDE { |
| 46 UseRealGLContexts(); |
| 47 TabCaptureApiTest::SetUp(); |
| 48 } |
| 49 }; |
| 50 |
60 } // namespace | 51 } // namespace |
61 | 52 |
62 IN_PROC_BROWSER_TEST_F(TabCaptureApiTest, ApiTests) { | 53 IN_PROC_BROWSER_TEST_F(TabCaptureApiTest, ApiTests) { |
63 #if defined(OS_WIN) && defined(USE_ASH) | 54 #if defined(OS_WIN) && defined(USE_ASH) |
64 // Disable this test in Metro+Ash for now (http://crbug.com/262796). | 55 // Disable this test in Metro+Ash for now (http://crbug.com/262796). |
65 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kAshBrowserTests)) | 56 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kAshBrowserTests)) |
66 return; | 57 return; |
67 #endif | 58 #endif |
68 | 59 |
69 #if defined(OS_WIN) | 60 #if defined(OS_WIN) |
(...skipping 19 matching lines...) Expand all Loading... |
89 ASSERT_TRUE(RunExtensionSubtest("tab_capture", "api_tests_audio.html")) | 80 ASSERT_TRUE(RunExtensionSubtest("tab_capture", "api_tests_audio.html")) |
90 << message_; | 81 << message_; |
91 } | 82 } |
92 | 83 |
93 // http://crbug.com/177163 | 84 // http://crbug.com/177163 |
94 #if !defined(NDEBUG) | 85 #if !defined(NDEBUG) |
95 #define MAYBE_EndToEnd DISABLED_EndToEnd | 86 #define MAYBE_EndToEnd DISABLED_EndToEnd |
96 #else | 87 #else |
97 #define MAYBE_EndToEnd EndToEnd | 88 #define MAYBE_EndToEnd EndToEnd |
98 #endif | 89 #endif |
99 IN_PROC_BROWSER_TEST_F(TabCaptureApiTest, MAYBE_EndToEnd) { | 90 IN_PROC_BROWSER_TEST_F(TabCaptureApiPixelTest, MAYBE_EndToEnd) { |
100 #if defined(OS_WIN) | 91 #if defined(OS_WIN) |
101 // TODO(justinlin): Disabled for WinXP due to timeout issues. | 92 // TODO(justinlin): Disabled for WinXP due to timeout issues. |
102 if (base::win::GetVersion() < base::win::VERSION_VISTA) { | 93 if (base::win::GetVersion() < base::win::VERSION_VISTA) { |
103 return; | 94 return; |
104 } | 95 } |
105 #endif | 96 #endif |
106 // This test is too slow to succeed with OSMesa on the bots. | 97 // This test is too slow to succeed with OSMesa on the bots. |
107 if (UsingOSMesa()) | 98 if (UsingOSMesa()) |
108 return; | 99 return; |
109 | 100 |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
298 #if defined(OS_WIN) && !defined(NDEBUG) | 289 #if defined(OS_WIN) && !defined(NDEBUG) |
299 #define MAYBE_Constraints DISABLED_Constraints | 290 #define MAYBE_Constraints DISABLED_Constraints |
300 #else | 291 #else |
301 #define MAYBE_Constraints Constraints | 292 #define MAYBE_Constraints Constraints |
302 #endif | 293 #endif |
303 IN_PROC_BROWSER_TEST_F(TabCaptureApiTest, MAYBE_Constraints) { | 294 IN_PROC_BROWSER_TEST_F(TabCaptureApiTest, MAYBE_Constraints) { |
304 AddExtensionToCommandLineWhitelist(); | 295 AddExtensionToCommandLineWhitelist(); |
305 ASSERT_TRUE(RunExtensionSubtest("tab_capture", "constraints.html")) | 296 ASSERT_TRUE(RunExtensionSubtest("tab_capture", "constraints.html")) |
306 << message_; | 297 << message_; |
307 } | 298 } |
OLD | NEW |