OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "base/synchronization/waitable_event.h" | 5 #include "base/synchronization/waitable_event.h" |
6 #include "chrome/browser/geolocation/geolocation_infobar_queue_controller.h" | 6 #include "chrome/browser/geolocation/geolocation_infobar_queue_controller.h" |
7 #include "chrome/browser/ui/tab_contents/test_tab_contents.h" | 7 #include "chrome/browser/ui/tab_contents/test_tab_contents.h" |
8 #include "chrome/test/base/testing_profile.h" | 8 #include "chrome/test/base/testing_profile.h" |
9 #include "content/public/browser/web_contents.h" | 9 #include "content/public/browser/web_contents.h" |
10 #include "content/public/test/mock_render_process_host.h" | 10 #include "content/public/test/mock_render_process_host.h" |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 int render_view_id, | 56 int render_view_id, |
57 int bridge_id, | 57 int bridge_id, |
58 const GURL& requesting_frame, | 58 const GURL& requesting_frame, |
59 base::Callback<void(bool)> callback, | 59 base::Callback<void(bool)> callback, |
60 bool allowed); | 60 bool allowed); |
61 }; | 61 }; |
62 | 62 |
63 ObservationCountingQueueController::ObservationCountingQueueController( | 63 ObservationCountingQueueController::ObservationCountingQueueController( |
64 Profile* profile) | 64 Profile* profile) |
65 : GeolocationInfoBarQueueController( | 65 : GeolocationInfoBarQueueController( |
66 base::Bind(&ObservationCountingQueueController::NotifyPermissionSet), | |
67 profile), | 66 profile), |
68 call_count_(0) { | 67 call_count_(0) { |
69 } | 68 } |
70 | 69 |
71 void ObservationCountingQueueController::Observe( | 70 void ObservationCountingQueueController::Observe( |
72 int type, | 71 int type, |
73 const content::NotificationSource& source, | 72 const content::NotificationSource& source, |
74 const content::NotificationDetails& details) { | 73 const content::NotificationDetails& details) { |
75 ++call_count_; | 74 ++call_count_; |
76 GeolocationInfoBarQueueController::Observe(type, source, details); | 75 GeolocationInfoBarQueueController::Observe(type, source, details); |
(...skipping 24 matching lines...) Expand all Loading... |
101 ObservationCountingQueueController infobar_queue_controller(profile()); | 100 ObservationCountingQueueController infobar_queue_controller(profile()); |
102 GURL url("http://www.example.com/geolocation"); | 101 GURL url("http://www.example.com/geolocation"); |
103 base::Callback<void(bool)> callback; | 102 base::Callback<void(bool)> callback; |
104 infobar_queue_controller.CreateInfoBarRequest(ProcessId(), RenderId(), 1, | 103 infobar_queue_controller.CreateInfoBarRequest(ProcessId(), RenderId(), 1, |
105 url, url, callback); | 104 url, url, callback); |
106 infobar_queue_controller.CreateInfoBarRequest(ProcessId(), RenderId(), 2, | 105 infobar_queue_controller.CreateInfoBarRequest(ProcessId(), RenderId(), 2, |
107 url, url, callback); | 106 url, url, callback); |
108 infobar_queue_controller.CancelInfoBarRequest(ProcessId(), RenderId(), 1); | 107 infobar_queue_controller.CancelInfoBarRequest(ProcessId(), RenderId(), 1); |
109 EXPECT_EQ(1, infobar_queue_controller.call_count()); | 108 EXPECT_EQ(1, infobar_queue_controller.call_count()); |
110 }; | 109 }; |
OLD | NEW |