| 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 #include "base/strings/stringprintf.h" | 7 #include "base/strings/stringprintf.h" |
| 8 #include "chrome/browser/extensions/extension_apitest.h" | 8 #include "chrome/browser/extensions/extension_apitest.h" |
| 9 #include "chrome/browser/extensions/extension_test_message_listener.h" | 9 #include "chrome/browser/extensions/extension_test_message_listener.h" |
| 10 #include "chrome/browser/extensions/tab_helper.h" | 10 #include "chrome/browser/extensions/tab_helper.h" |
| 11 #include "chrome/browser/profiles/profile.h" | 11 #include "chrome/browser/profiles/profile.h" |
| 12 #include "chrome/browser/ui/fullscreen/fullscreen_controller.h" | 12 #include "chrome/browser/ui/fullscreen/fullscreen_controller.h" |
| 13 #include "chrome/common/chrome_version_info.h" | 13 #include "chrome/common/chrome_version_info.h" |
| 14 #include "content/public/browser/render_frame_host.h" |
| 14 #include "content/public/browser/render_process_host.h" | 15 #include "content/public/browser/render_process_host.h" |
| 15 #include "content/public/browser/render_view_host.h" | |
| 16 #include "extensions/browser/extension_registry.h" | 16 #include "extensions/browser/extension_registry.h" |
| 17 #include "extensions/common/switches.h" | 17 #include "extensions/common/switches.h" |
| 18 | 18 |
| 19 #if defined(OS_WIN) | 19 #if defined(OS_WIN) |
| 20 #include "base/win/windows_version.h" | 20 #include "base/win/windows_version.h" |
| 21 #endif | 21 #endif |
| 22 | 22 |
| 23 #if defined(OS_WIN) && defined(USE_ASH) | 23 #if defined(OS_WIN) && defined(USE_ASH) |
| 24 #include "chrome/test/base/test_switches.h" | 24 #include "chrome/test/base/test_switches.h" |
| 25 #endif | 25 #endif |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 ASSERT_TRUE(RunExtensionSubtest("tab_capture", "get_user_media_test.html")) | 112 ASSERT_TRUE(RunExtensionSubtest("tab_capture", "get_user_media_test.html")) |
| 113 << message_; | 113 << message_; |
| 114 | 114 |
| 115 EXPECT_TRUE(listener.WaitUntilSatisfied()); | 115 EXPECT_TRUE(listener.WaitUntilSatisfied()); |
| 116 | 116 |
| 117 content::OpenURLParams params(GURL("about:blank"), content::Referrer(), | 117 content::OpenURLParams params(GURL("about:blank"), content::Referrer(), |
| 118 NEW_FOREGROUND_TAB, | 118 NEW_FOREGROUND_TAB, |
| 119 content::PAGE_TRANSITION_LINK, false); | 119 content::PAGE_TRANSITION_LINK, false); |
| 120 content::WebContents* web_contents = browser()->OpenURL(params); | 120 content::WebContents* web_contents = browser()->OpenURL(params); |
| 121 | 121 |
| 122 content::RenderViewHost* const rvh = web_contents->GetRenderViewHost(); | 122 content::RenderFrameHost* const main_frame = web_contents->GetMainFrame(); |
| 123 int render_process_id = rvh->GetProcess()->GetID(); | 123 ASSERT_TRUE(main_frame); |
| 124 int routing_id = rvh->GetRoutingID(); | 124 listener.Reply(base::StringPrintf("web-contents-media-stream://%i:%i", |
| 125 | 125 main_frame->GetProcess()->GetID(), |
| 126 listener.Reply(base::StringPrintf("%i:%i", render_process_id, routing_id)); | 126 main_frame->GetRoutingID())); |
| 127 | 127 |
| 128 ResultCatcher catcher; | 128 ResultCatcher catcher; |
| 129 catcher.RestrictToProfile(browser()->profile()); | 129 catcher.RestrictToProfile(browser()->profile()); |
| 130 EXPECT_TRUE(catcher.GetNextResult()) << catcher.message(); | 130 EXPECT_TRUE(catcher.GetNextResult()) << catcher.message(); |
| 131 } | 131 } |
| 132 | 132 |
| 133 // http://crbug.com/177163 | 133 // http://crbug.com/177163 |
| 134 #if defined(OS_WIN) && !defined(NDEBUG) | 134 #if defined(OS_WIN) && !defined(NDEBUG) |
| 135 #define MAYBE_ActiveTabPermission DISABLED_ActiveTabPermission | 135 #define MAYBE_ActiveTabPermission DISABLED_ActiveTabPermission |
| 136 #else | 136 #else |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 286 #endif | 286 #endif |
| 287 IN_PROC_BROWSER_TEST_F(TabCaptureApiTest, MAYBE_Constraints) { | 287 IN_PROC_BROWSER_TEST_F(TabCaptureApiTest, MAYBE_Constraints) { |
| 288 AddExtensionToCommandLineWhitelist(); | 288 AddExtensionToCommandLineWhitelist(); |
| 289 ASSERT_TRUE(RunExtensionSubtest("tab_capture", "constraints.html")) | 289 ASSERT_TRUE(RunExtensionSubtest("tab_capture", "constraints.html")) |
| 290 << message_; | 290 << message_; |
| 291 } | 291 } |
| 292 | 292 |
| 293 } // namespace | 293 } // namespace |
| 294 | 294 |
| 295 } // namespace extensions | 295 } // namespace extensions |
| OLD | NEW |