| OLD | NEW |
| (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 |
| OLD | NEW |