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

Side by Side Diff: chrome/browser/policy/policy_browsertest.cc

Issue 180633008: Add different error codes for getUserMedia. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed comments Created 6 years, 9 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 | Annotate | Revision Log
OLDNEW
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 <algorithm> 5 #include <algorithm>
6 #include <string> 6 #include <string>
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 2709 matching lines...) Expand 10 before | Expand all | Expand 10 after
2720 // though we've added an entry, it should be ignored and our expectation 2720 // though we've added an entry, it should be ignored and our expectation
2721 // is that the request has not been allowed via the whitelist. 2721 // is that the request has not been allowed via the whitelist.
2722 request_url_allowed_via_whitelist_ = false; 2722 request_url_allowed_via_whitelist_ = false;
2723 } 2723 }
2724 policies->Set(whitelist_policy, POLICY_LEVEL_MANDATORY, 2724 policies->Set(whitelist_policy, POLICY_LEVEL_MANDATORY,
2725 POLICY_SCOPE_USER, list, NULL); 2725 POLICY_SCOPE_USER, list, NULL);
2726 } 2726 }
2727 } 2727 }
2728 2728
2729 void Accept(const content::MediaStreamDevices& devices, 2729 void Accept(const content::MediaStreamDevices& devices,
2730 content::MediaStreamRequestResult result,
2730 scoped_ptr<content::MediaStreamUI> ui) { 2731 scoped_ptr<content::MediaStreamUI> ui) {
2731 if (policy_value_ || request_url_allowed_via_whitelist_) { 2732 if (policy_value_ || request_url_allowed_via_whitelist_) {
2732 ASSERT_EQ(1U, devices.size()); 2733 ASSERT_EQ(1U, devices.size());
2733 ASSERT_EQ("fake_dev", devices[0].id); 2734 ASSERT_EQ("fake_dev", devices[0].id);
2734 } else { 2735 } else {
2735 ASSERT_EQ(0U, devices.size()); 2736 ASSERT_EQ(0U, devices.size());
2736 } 2737 }
2737 } 2738 }
2738 2739
2739 void FinishAudioTest() { 2740 void FinishAudioTest() {
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after
2976 PrefService* prefs = browser()->profile()->GetPrefs(); 2977 PrefService* prefs = browser()->profile()->GetPrefs();
2977 EXPECT_TRUE(extensions::NativeMessageProcessHost::IsHostAllowed( 2978 EXPECT_TRUE(extensions::NativeMessageProcessHost::IsHostAllowed(
2978 prefs, "host.name")); 2979 prefs, "host.name"));
2979 EXPECT_FALSE(extensions::NativeMessageProcessHost::IsHostAllowed( 2980 EXPECT_FALSE(extensions::NativeMessageProcessHost::IsHostAllowed(
2980 prefs, "other.host.name")); 2981 prefs, "other.host.name"));
2981 } 2982 }
2982 2983
2983 #endif // !defined(CHROME_OS) 2984 #endif // !defined(CHROME_OS)
2984 2985
2985 } // namespace policy 2986 } // namespace policy
OLDNEW
« no previous file with comments | « chrome/browser/media/webrtc_browsertest_base.cc ('k') | chrome/test/data/webrtc/getusermedia.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698