| Index: chrome/browser/media/midi_permission_context_unittest.cc
|
| diff --git a/chrome/browser/media/midi_permission_context_unittest.cc b/chrome/browser/media/midi_permission_context_unittest.cc
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..2f215c10849ad1d3f6f47c96f165ece3c95e45db
|
| --- /dev/null
|
| +++ b/chrome/browser/media/midi_permission_context_unittest.cc
|
| @@ -0,0 +1,47 @@
|
| +// Copyright 2017 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#include "chrome/browser/media/midi_permission_context.h"
|
| +#include "chrome/test/base/testing_profile.h"
|
| +#include "components/content_settings/core/common/content_settings.h"
|
| +#include "content/public/test/test_browser_thread_bundle.h"
|
| +#include "testing/gtest/include/gtest/gtest.h"
|
| +
|
| +namespace {
|
| +
|
| +class MidiPermissionContextTests : public testing::Test {
|
| + public:
|
| + TestingProfile* profile() { return &profile_; }
|
| +
|
| + private:
|
| + content::TestBrowserThreadBundle thread_bundle_;
|
| + TestingProfile profile_;
|
| +};
|
| +
|
| +// Web MIDI permission status should be allowed for all origins.
|
| +TEST_F(MidiPermissionContextTests, TestNoSysexAllowedAllOrigins) {
|
| + MidiPermissionContext permission_context(profile());
|
| + GURL insecure_url("http://www.example.com");
|
| + GURL secure_url("https://www.example.com");
|
| +
|
| + EXPECT_EQ(CONTENT_SETTING_ALLOW,
|
| + permission_context
|
| + .GetPermissionStatus(nullptr /* render_frame_host */,
|
| + insecure_url, insecure_url)
|
| + .content_setting);
|
| +
|
| + EXPECT_EQ(CONTENT_SETTING_ALLOW,
|
| + permission_context
|
| + .GetPermissionStatus(nullptr /* render_frame_host */,
|
| + insecure_url, secure_url)
|
| + .content_setting);
|
| +
|
| + EXPECT_EQ(CONTENT_SETTING_ALLOW,
|
| + permission_context
|
| + .GetPermissionStatus(nullptr /* render_frame_host */,
|
| + secure_url, secure_url)
|
| + .content_setting);
|
| +}
|
| +
|
| +} // namespace
|
|
|