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

Side by Side Diff: chrome/browser/geolocation/geolocation_infobar_queue_controller_unittest.cc

Issue 14113053: chrome: Use base::MessageLoop. (Part 3) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 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 | Annotate | Revision Log
OLDNEW
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/geolocation/geolocation_permission_request_id.h" 7 #include "chrome/browser/geolocation/geolocation_permission_request_id.h"
8 #include "chrome/browser/infobars/infobar_service.h" 8 #include "chrome/browser/infobars/infobar_service.h"
9 #include "chrome/test/base/chrome_render_view_host_test_harness.h" 9 #include "chrome/test/base/chrome_render_view_host_test_harness.h"
10 #include "chrome/test/base/testing_profile.h" 10 #include "chrome/test/base/testing_profile.h"
(...skipping 13 matching lines...) Expand all
24 private: 24 private:
25 // ChromeRenderViewHostTestHarness: 25 // ChromeRenderViewHostTestHarness:
26 virtual void SetUp() OVERRIDE; 26 virtual void SetUp() OVERRIDE;
27 27
28 content::TestBrowserThread ui_thread_; 28 content::TestBrowserThread ui_thread_;
29 29
30 DISALLOW_COPY_AND_ASSIGN(GeolocationInfoBarQueueControllerTests); 30 DISALLOW_COPY_AND_ASSIGN(GeolocationInfoBarQueueControllerTests);
31 }; 31 };
32 32
33 GeolocationInfoBarQueueControllerTests::GeolocationInfoBarQueueControllerTests() 33 GeolocationInfoBarQueueControllerTests::GeolocationInfoBarQueueControllerTests()
34 : ui_thread_(content::BrowserThread::UI, MessageLoop::current()) { 34 : ui_thread_(content::BrowserThread::UI, base::MessageLoop::current()) {}
35 }
36 35
37 GeolocationPermissionRequestID 36 GeolocationPermissionRequestID
38 GeolocationInfoBarQueueControllerTests::RequestID(int bridge_id) { 37 GeolocationInfoBarQueueControllerTests::RequestID(int bridge_id) {
39 return GeolocationPermissionRequestID( 38 return GeolocationPermissionRequestID(
40 web_contents()->GetRenderProcessHost()->GetID(), 39 web_contents()->GetRenderProcessHost()->GetID(),
41 web_contents()->GetRenderViewHost()->GetRoutingID(), 40 web_contents()->GetRenderViewHost()->GetRoutingID(),
42 bridge_id); 41 bridge_id);
43 } 42 }
44 43
45 void GeolocationInfoBarQueueControllerTests::SetUp() { 44 void GeolocationInfoBarQueueControllerTests::SetUp() {
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 ObservationCountingQueueController infobar_queue_controller(profile()); 105 ObservationCountingQueueController infobar_queue_controller(profile());
107 GURL url("http://www.example.com/geolocation"); 106 GURL url("http://www.example.com/geolocation");
108 base::Callback<void(bool)> callback; 107 base::Callback<void(bool)> callback;
109 infobar_queue_controller.CreateInfoBarRequest(RequestID(0), url, url, 108 infobar_queue_controller.CreateInfoBarRequest(RequestID(0), url, url,
110 callback); 109 callback);
111 infobar_queue_controller.CreateInfoBarRequest(RequestID(1), url, url, 110 infobar_queue_controller.CreateInfoBarRequest(RequestID(1), url, url,
112 callback); 111 callback);
113 infobar_queue_controller.CancelInfoBarRequest(RequestID(0)); 112 infobar_queue_controller.CancelInfoBarRequest(RequestID(0));
114 EXPECT_EQ(1, infobar_queue_controller.call_count()); 113 EXPECT_EQ(1, infobar_queue_controller.call_count());
115 }; 114 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698