| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "chrome/browser/media/midi_permission_context.h" | 5 #include "chrome/browser/media/midi_permission_context.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "chrome/browser/content_settings/permission_queue_controller.h" | 8 #include "chrome/browser/content_settings/permission_queue_controller.h" |
| 9 #include "chrome/browser/infobars/infobar_service.h" | 9 #include "chrome/browser/infobars/infobar_service.h" |
| 10 #include "chrome/browser/permissions/permission_request_id.h" |
| 10 #include "chrome/browser/ui/website_settings/permission_bubble_manager.h" | 11 #include "chrome/browser/ui/website_settings/permission_bubble_manager.h" |
| 11 #include "chrome/test/base/chrome_render_view_host_test_harness.h" | 12 #include "chrome/test/base/chrome_render_view_host_test_harness.h" |
| 12 #include "chrome/test/base/testing_profile.h" | 13 #include "chrome/test/base/testing_profile.h" |
| 13 #include "components/content_settings/core/browser/host_content_settings_map.h" | 14 #include "components/content_settings/core/browser/host_content_settings_map.h" |
| 14 #include "components/content_settings/core/common/content_settings.h" | 15 #include "components/content_settings/core/common/content_settings.h" |
| 15 #include "components/content_settings/core/common/content_settings_types.h" | 16 #include "components/content_settings/core/common/content_settings_types.h" |
| 16 #include "components/content_settings/core/common/permission_request_id.h" | |
| 17 #include "content/public/browser/web_contents.h" | 17 #include "content/public/browser/web_contents.h" |
| 18 #include "content/public/test/mock_render_process_host.h" | 18 #include "content/public/test/mock_render_process_host.h" |
| 19 #include "content/public/test/web_contents_tester.h" | 19 #include "content/public/test/web_contents_tester.h" |
| 20 #include "testing/gtest/include/gtest/gtest.h" | 20 #include "testing/gtest/include/gtest/gtest.h" |
| 21 | 21 |
| 22 namespace { | 22 namespace { |
| 23 | 23 |
| 24 class TestPermissionContext : public MidiPermissionContext { | 24 class TestPermissionContext : public MidiPermissionContext { |
| 25 public: | 25 public: |
| 26 explicit TestPermissionContext(Profile* profile) | 26 explicit TestPermissionContext(Profile* profile) |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 EXPECT_EQ(CONTENT_SETTING_ASK, | 127 EXPECT_EQ(CONTENT_SETTING_ASK, |
| 128 profile()->GetHostContentSettingsMap()->GetContentSetting( | 128 profile()->GetHostContentSettingsMap()->GetContentSetting( |
| 129 insecure_url.GetOrigin(), secure_url.GetOrigin(), | 129 insecure_url.GetOrigin(), secure_url.GetOrigin(), |
| 130 CONTENT_SETTINGS_TYPE_MIDI_SYSEX, std::string())); | 130 CONTENT_SETTINGS_TYPE_MIDI_SYSEX, std::string())); |
| 131 | 131 |
| 132 EXPECT_EQ(CONTENT_SETTING_BLOCK, permission_context.GetPermissionStatus( | 132 EXPECT_EQ(CONTENT_SETTING_BLOCK, permission_context.GetPermissionStatus( |
| 133 insecure_url, insecure_url)); | 133 insecure_url, insecure_url)); |
| 134 EXPECT_EQ(CONTENT_SETTING_BLOCK, permission_context.GetPermissionStatus( | 134 EXPECT_EQ(CONTENT_SETTING_BLOCK, permission_context.GetPermissionStatus( |
| 135 insecure_url, secure_url)); | 135 insecure_url, secure_url)); |
| 136 } | 136 } |
| OLD | NEW |