Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(78)

Side by Side Diff: chrome/browser/media/chrome_webrtc_webcam_browsertest.cc

Issue 1286363002: Switch media stream permissions to use IsOriginSecure() instead of SchemeIsSecure(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address nits. Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/command_line.h" 5 #include "base/command_line.h"
6 #include "chrome/browser/media/webrtc_browsertest_base.h" 6 #include "chrome/browser/media/webrtc_browsertest_base.h"
7 #include "chrome/browser/media/webrtc_browsertest_common.h" 7 #include "chrome/browser/media/webrtc_browsertest_common.h"
8 #include "chrome/browser/ui/browser.h" 8 #include "chrome/browser/ui/browser.h"
9 #include "chrome/browser/ui/browser_tabstrip.h" 9 #include "chrome/browser/ui/browser_tabstrip.h"
10 #include "chrome/browser/ui/tabs/tab_strip_model.h" 10 #include "chrome/browser/ui/tabs/tab_strip_model.h"
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 } 49 }
50 50
51 protected: 51 protected:
52 void SetUpInProcessBrowserTestFixture() override { 52 void SetUpInProcessBrowserTestFixture() override {
53 DetectErrorsInJavaScript(); // Look for errors in our rather complex js. 53 DetectErrorsInJavaScript(); // Look for errors in our rather complex js.
54 } 54 }
55 55
56 std::string GetUserMediaAndGetStreamSize(content::WebContents* tab, 56 std::string GetUserMediaAndGetStreamSize(content::WebContents* tab,
57 const std::string& constraints) { 57 const std::string& constraints) {
58 std::string actual_stream_size; 58 std::string actual_stream_size;
59 if (GetUserMediaWithSpecificConstraintsAndAccept(tab, constraints)) { 59 if (GetUserMediaWithSpecificConstraintsAndAcceptIfPrompted(tab,
60 constraints)) {
60 StartDetectingVideo(tab, "local-view"); 61 StartDetectingVideo(tab, "local-view");
61 if (WaitForVideoToPlay(tab)) 62 if (WaitForVideoToPlay(tab))
62 actual_stream_size = GetStreamSize(tab, "local-view"); 63 actual_stream_size = GetStreamSize(tab, "local-view");
63 CloseLastLocalStream(tab); 64 CloseLastLocalStream(tab);
64 } 65 }
65 return actual_stream_size; 66 return actual_stream_size;
66 } 67 }
67 68
68 bool IsOnQtKit() const { 69 bool IsOnQtKit() const {
69 #if defined(OS_MACOSX) 70 #if defined(OS_MACOSX)
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 106
106 EXPECT_EQ("1280x720", 107 EXPECT_EQ("1280x720",
107 GetUserMediaAndGetStreamSize(tab, kVideoCallConstraints720p)); 108 GetUserMediaAndGetStreamSize(tab, kVideoCallConstraints720p));
108 EXPECT_EQ("1920x1080", 109 EXPECT_EQ("1920x1080",
109 GetUserMediaAndGetStreamSize(tab, kVideoCallConstraints1080p)); 110 GetUserMediaAndGetStreamSize(tab, kVideoCallConstraints1080p));
110 } 111 }
111 112
112 INSTANTIATE_TEST_CASE_P(WebRtcWebcamBrowserTests, 113 INSTANTIATE_TEST_CASE_P(WebRtcWebcamBrowserTests,
113 WebRtcWebcamBrowserTest, 114 WebRtcWebcamBrowserTest,
114 testing::ValuesIn(kTestConfigFlags)); 115 testing::ValuesIn(kTestConfigFlags));
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698