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

Side by Side Diff: chrome/browser/content_settings/permission_queue_controller_unittest.cc

Issue 107413006: Dismiss EME infobar when WebMediaPlayer is destroyed. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: make FakeProfile class happy Created 6 years, 11 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
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"
(...skipping 10 matching lines...) Expand all
21 21
22 class PermissionQueueControllerTests : public ChromeRenderViewHostTestHarness { 22 class PermissionQueueControllerTests : public ChromeRenderViewHostTestHarness {
23 protected: 23 protected:
24 PermissionQueueControllerTests() {} 24 PermissionQueueControllerTests() {}
25 virtual ~PermissionQueueControllerTests() {} 25 virtual ~PermissionQueueControllerTests() {}
26 26
27 PermissionRequestID RequestID(int bridge_id) { 27 PermissionRequestID RequestID(int bridge_id) {
28 return PermissionRequestID( 28 return PermissionRequestID(
29 web_contents()->GetRenderProcessHost()->GetID(), 29 web_contents()->GetRenderProcessHost()->GetID(),
30 web_contents()->GetRenderViewHost()->GetRoutingID(), 30 web_contents()->GetRenderViewHost()->GetRoutingID(),
31 bridge_id); 31 bridge_id,
32 0);
32 } 33 }
33 34
34 private: 35 private:
35 // ChromeRenderViewHostTestHarness: 36 // ChromeRenderViewHostTestHarness:
36 virtual void SetUp() OVERRIDE { 37 virtual void SetUp() OVERRIDE {
37 ChromeRenderViewHostTestHarness::SetUp(); 38 ChromeRenderViewHostTestHarness::SetUp();
38 InfoBarService::CreateForWebContents(web_contents()); 39 InfoBarService::CreateForWebContents(web_contents());
39 } 40 }
40 41
41 DISALLOW_COPY_AND_ASSIGN(PermissionQueueControllerTests); 42 DISALLOW_COPY_AND_ASSIGN(PermissionQueueControllerTests);
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 // test checks that in the case where the controller should remain registered 95 // test checks that in the case where the controller should remain registered
95 // for notifications, it gets notified exactly once." 96 // for notifications, it gets notified exactly once."
96 ObservationCountingQueueController queue_controller(profile()); 97 ObservationCountingQueueController queue_controller(profile());
97 GURL url("http://www.example.com/geolocation"); 98 GURL url("http://www.example.com/geolocation");
98 base::Callback<void(bool)> callback; 99 base::Callback<void(bool)> callback;
99 queue_controller.CreateInfoBarRequest(RequestID(0), url, url, callback); 100 queue_controller.CreateInfoBarRequest(RequestID(0), url, url, callback);
100 queue_controller.CreateInfoBarRequest(RequestID(1), url, url, callback); 101 queue_controller.CreateInfoBarRequest(RequestID(1), url, url, callback);
101 queue_controller.CancelInfoBarRequest(RequestID(0)); 102 queue_controller.CancelInfoBarRequest(RequestID(0));
102 EXPECT_EQ(1, queue_controller.call_count()); 103 EXPECT_EQ(1, queue_controller.call_count());
103 }; 104 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698