| 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/stringprintf.h" | 5 #include "base/stringprintf.h" |
| 6 #include "base/win/windows_version.h" |
| 6 #include "chrome/browser/extensions/extension_apitest.h" | 7 #include "chrome/browser/extensions/extension_apitest.h" |
| 7 #include "chrome/browser/extensions/extension_test_message_listener.h" | 8 #include "chrome/browser/extensions/extension_test_message_listener.h" |
| 8 #include "chrome/common/chrome_version_info.h" | 9 #include "chrome/common/chrome_version_info.h" |
| 9 #include "chrome/common/extensions/feature_switch.h" | 10 #include "chrome/common/extensions/feature_switch.h" |
| 10 #include "chrome/common/extensions/features/feature.h" | 11 #include "chrome/common/extensions/features/feature.h" |
| 11 #include "content/public/browser/render_process_host.h" | 12 #include "content/public/browser/render_process_host.h" |
| 12 #include "content/public/browser/render_view_host.h" | 13 #include "content/public/browser/render_view_host.h" |
| 13 #include "content/public/common/content_switches.h" | 14 #include "content/public/common/content_switches.h" |
| 14 | 15 |
| 15 namespace chrome { | 16 namespace chrome { |
| 16 | 17 |
| 17 namespace { | 18 namespace { |
| 18 | 19 |
| 19 class TabCaptureApiTest : public ExtensionApiTest { | 20 class TabCaptureApiTest : public ExtensionApiTest { |
| 20 public: | 21 public: |
| 21 TabCaptureApiTest() : current_channel_(VersionInfo::CHANNEL_UNKNOWN) {} | 22 TabCaptureApiTest() : current_channel_(VersionInfo::CHANNEL_UNKNOWN) {} |
| 22 | 23 |
| 23 private: | 24 private: |
| 24 extensions::Feature::ScopedCurrentChannel current_channel_; | 25 extensions::Feature::ScopedCurrentChannel current_channel_; |
| 25 }; | 26 }; |
| 26 | 27 |
| 27 } // namespace | 28 } // namespace |
| 28 | 29 |
| 29 // Flaky. http://crbug.com/224249 | 30 IN_PROC_BROWSER_TEST_F(TabCaptureApiTest, ApiTests) { |
| 30 IN_PROC_BROWSER_TEST_F(TabCaptureApiTest, DISABLED_ApiTests) { | |
| 31 extensions::FeatureSwitch::ScopedOverride tab_capture( | 31 extensions::FeatureSwitch::ScopedOverride tab_capture( |
| 32 extensions::FeatureSwitch::tab_capture(), true); | 32 extensions::FeatureSwitch::tab_capture(), true); |
| 33 |
| 34 #if defined(OS_WIN) |
| 35 // TODO(justinlin): Disabled for WinXP due to timeout issues. |
| 36 if (base::win::GetVersion() < base::win::VERSION_VISTA) { |
| 37 return; |
| 38 } |
| 39 #endif |
| 40 |
| 33 ASSERT_TRUE(RunExtensionSubtest("tab_capture/experimental", | 41 ASSERT_TRUE(RunExtensionSubtest("tab_capture/experimental", |
| 34 "api_tests.html")) << message_; | 42 "api_tests.html")) << message_; |
| 35 } | 43 } |
| 36 | 44 |
| 37 // Flaky. http://crbug.com/224249 | 45 IN_PROC_BROWSER_TEST_F(TabCaptureApiTest, ApiTestsAudio) { |
| 38 IN_PROC_BROWSER_TEST_F(TabCaptureApiTest, DISABLED_ApiTestsAudio) { | |
| 39 extensions::FeatureSwitch::ScopedOverride tab_capture( | 46 extensions::FeatureSwitch::ScopedOverride tab_capture( |
| 40 extensions::FeatureSwitch::tab_capture(), true); | 47 extensions::FeatureSwitch::tab_capture(), true); |
| 48 |
| 49 #if defined(OS_WIN) |
| 50 // TODO(justinlin): Disabled for WinXP due to timeout issues. |
| 51 if (base::win::GetVersion() < base::win::VERSION_VISTA) { |
| 52 return; |
| 53 } |
| 54 #endif |
| 55 |
| 41 ASSERT_TRUE(RunExtensionSubtest("tab_capture/experimental", | 56 ASSERT_TRUE(RunExtensionSubtest("tab_capture/experimental", |
| 42 "api_tests_audio.html")) << message_; | 57 "api_tests_audio.html")) << message_; |
| 43 } | 58 } |
| 44 | 59 |
| 45 // TODO(miu): Disabled until the two most-likely sources of the "flaky timeouts" | 60 // TODO(miu): Disabled until the two most-likely sources of the "flaky timeouts" |
| 46 // are resolved: 1) http://crbug.com/177163 and 2) http://crbug.com/174519. | 61 // are resolved: 1) http://crbug.com/177163 and 2) http://crbug.com/174519. |
| 47 // See http://crbug.com/174640. | 62 // See http://crbug.com/174640. |
| 48 IN_PROC_BROWSER_TEST_F(TabCaptureApiTest, DISABLED_EndToEnd) { | 63 IN_PROC_BROWSER_TEST_F(TabCaptureApiTest, DISABLED_EndToEnd) { |
| 49 extensions::FeatureSwitch::ScopedOverride tab_capture( | 64 extensions::FeatureSwitch::ScopedOverride tab_capture( |
| 50 extensions::FeatureSwitch::tab_capture(), true); | 65 extensions::FeatureSwitch::tab_capture(), true); |
| (...skipping 20 matching lines...) Expand all Loading... |
| 71 int routing_id = rvh->GetRoutingID(); | 86 int routing_id = rvh->GetRoutingID(); |
| 72 | 87 |
| 73 listener.Reply(base::StringPrintf("%i:%i", render_process_id, routing_id)); | 88 listener.Reply(base::StringPrintf("%i:%i", render_process_id, routing_id)); |
| 74 | 89 |
| 75 ResultCatcher catcher; | 90 ResultCatcher catcher; |
| 76 catcher.RestrictToProfile(browser()->profile()); | 91 catcher.RestrictToProfile(browser()->profile()); |
| 77 EXPECT_TRUE(catcher.GetNextResult()) << catcher.message(); | 92 EXPECT_TRUE(catcher.GetNextResult()) << catcher.message(); |
| 78 } | 93 } |
| 79 | 94 |
| 80 } // namespace chrome | 95 } // namespace chrome |
| OLD | NEW |