| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/content_settings/permission_queue_controller.h" | 5 #include "chrome/browser/content_settings/permission_queue_controller.h" |
| 6 | 6 |
| 7 #include "base/synchronization/waitable_event.h" | 7 #include "base/synchronization/waitable_event.h" |
| 8 #include "chrome/browser/chrome_notification_types.h" | 8 #include "chrome/browser/chrome_notification_types.h" |
| 9 #include "chrome/browser/content_settings/permission_request_id.h" | 9 #include "chrome/browser/content_settings/permission_request_id.h" |
| 10 #include "chrome/browser/infobars/infobar_service.h" | 10 #include "chrome/browser/infobars/infobar_service.h" |
| 11 #include "chrome/common/content_settings_types.h" | 11 #include "chrome/common/content_settings_types.h" |
| 12 #include "chrome/test/base/chrome_render_view_host_test_harness.h" | 12 #include "chrome/test/base/chrome_render_view_host_test_harness.h" |
| 13 #include "chrome/test/base/testing_profile.h" | 13 #include "chrome/test/base/testing_profile.h" |
| 14 #include "content/public/browser/web_contents.h" | 14 #include "content/public/browser/web_contents.h" |
| 15 #include "content/public/test/mock_render_process_host.h" | 15 #include "content/public/test/mock_render_process_host.h" |
| 16 #include "content/public/test/test_browser_thread.h" | |
| 17 #include "testing/gtest/include/gtest/gtest.h" | 16 #include "testing/gtest/include/gtest/gtest.h" |
| 18 | 17 |
| 19 | 18 |
| 20 // PermissionQueueControllerTests --------------------------------------------- | 19 // PermissionQueueControllerTests --------------------------------------------- |
| 21 | 20 |
| 22 class PermissionQueueControllerTests : public ChromeRenderViewHostTestHarness { | 21 class PermissionQueueControllerTests : public ChromeRenderViewHostTestHarness { |
| 23 protected: | 22 protected: |
| 24 PermissionQueueControllerTests() {} | 23 PermissionQueueControllerTests() {} |
| 25 virtual ~PermissionQueueControllerTests() {} | 24 virtual ~PermissionQueueControllerTests() {} |
| 26 | 25 |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 // test checks that in the case where the controller should remain registered | 94 // test checks that in the case where the controller should remain registered |
| 96 // for notifications, it gets notified exactly once." | 95 // for notifications, it gets notified exactly once." |
| 97 ObservationCountingQueueController queue_controller(profile()); | 96 ObservationCountingQueueController queue_controller(profile()); |
| 98 GURL url("http://www.example.com/geolocation"); | 97 GURL url("http://www.example.com/geolocation"); |
| 99 base::Callback<void(bool)> callback; | 98 base::Callback<void(bool)> callback; |
| 100 queue_controller.CreateInfoBarRequest(RequestID(0), url, url, callback); | 99 queue_controller.CreateInfoBarRequest(RequestID(0), url, url, callback); |
| 101 queue_controller.CreateInfoBarRequest(RequestID(1), url, url, callback); | 100 queue_controller.CreateInfoBarRequest(RequestID(1), url, url, callback); |
| 102 queue_controller.CancelInfoBarRequest(RequestID(0)); | 101 queue_controller.CancelInfoBarRequest(RequestID(0)); |
| 103 EXPECT_EQ(1, queue_controller.call_count()); | 102 EXPECT_EQ(1, queue_controller.call_count()); |
| 104 }; | 103 }; |
| OLD | NEW |