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

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

Issue 2914963002: Allow web-midi permission to be granted to insecure origins (Closed)
Patch Set: Allow web-midi permission to be granted to insecure origins Created 3 years, 6 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
(Empty)
1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "chrome/browser/media/midi_permission_context.h"
6 #include "chrome/test/base/testing_profile.h"
7 #include "components/content_settings/core/common/content_settings.h"
8 #include "content/public/test/test_browser_thread_bundle.h"
9 #include "testing/gtest/include/gtest/gtest.h"
10
11 namespace {
12
13 class MidiPermissionContextTests : public testing::Test {
14 public:
15 TestingProfile* profile() { return &profile_; }
16
17 private:
18 content::TestBrowserThreadBundle thread_bundle_;
19 TestingProfile profile_;
20 };
21
22 // Web MIDI permission status should be allowed for all origins.
23 TEST_F(MidiPermissionContextTests, TestNoSysexAllowedAllOrigins) {
24 MidiPermissionContext permission_context(profile());
25 GURL insecure_url("http://www.example.com");
26 GURL secure_url("https://www.example.com");
27
28 EXPECT_EQ(CONTENT_SETTING_ALLOW,
29 permission_context
30 .GetPermissionStatus(nullptr /* render_frame_host */,
31 insecure_url, insecure_url)
32 .content_setting);
33
34 EXPECT_EQ(CONTENT_SETTING_ALLOW,
35 permission_context
36 .GetPermissionStatus(nullptr /* render_frame_host */,
37 insecure_url, secure_url)
38 .content_setting);
39
40 EXPECT_EQ(CONTENT_SETTING_ALLOW,
41 permission_context
42 .GetPermissionStatus(nullptr /* render_frame_host */,
43 secure_url, secure_url)
44 .content_setting);
45 }
46
47 } // namespace
OLDNEW
« no previous file with comments | « chrome/browser/media/midi_permission_context.cc ('k') | chrome/browser/media/midi_sysex_permission_context_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698