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

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

Issue 1395103003: Don't use base::MessageLoop::{Quit,QuitClosure} in chrome/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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 (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 <string> 5 #include <string>
6 6
7 #include "base/compiler_specific.h" 7 #include "base/compiler_specific.h"
8 #include "base/strings/string_number_conversions.h" 8 #include "base/strings/string_number_conversions.h"
9 #include "base/strings/stringprintf.h" 9 #include "base/strings/stringprintf.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 const content::NotificationSource& source, 115 const content::NotificationSource& source,
116 const content::NotificationDetails& details) { 116 const content::NotificationDetails& details) {
117 if (type == content::NOTIFICATION_LOAD_STOP) { 117 if (type == content::NOTIFICATION_LOAD_STOP) {
118 navigation_completed_ = true; 118 navigation_completed_ = true;
119 } else if (type == content::NOTIFICATION_DOM_OPERATION_RESPONSE) { 119 } else if (type == content::NOTIFICATION_DOM_OPERATION_RESPONSE) {
120 content::Details<std::string> dom_op_result(details); 120 content::Details<std::string> dom_op_result(details);
121 javascript_response_ = *dom_op_result.ptr(); 121 javascript_response_ = *dom_op_result.ptr();
122 javascript_completed_ = true; 122 javascript_completed_ = true;
123 } 123 }
124 if (javascript_completed_ && navigation_completed_) 124 if (javascript_completed_ && navigation_completed_)
125 base::MessageLoopForUI::current()->Quit(); 125 base::MessageLoopForUI::current()->QuitWhenIdle();
126 } 126 }
127 127
128 // PermissionBubbleObserver --------------------------------------------------- 128 // PermissionBubbleObserver ---------------------------------------------------
129 129
130 // Used to observe the creation of a single permission bubble without 130 // Used to observe the creation of a single permission bubble without
131 // responding. 131 // responding.
132 class PermissionBubbleObserver : public PermissionBubbleManager::Observer { 132 class PermissionBubbleObserver : public PermissionBubbleManager::Observer {
133 public: 133 public:
134 explicit PermissionBubbleObserver(content::WebContents* web_contents) 134 explicit PermissionBubbleObserver(content::WebContents* web_contents)
135 : bubble_manager_(PermissionBubbleManager::FromWebContents(web_contents)), 135 : bubble_manager_(PermissionBubbleManager::FromWebContents(web_contents)),
(...skipping 625 matching lines...) Expand 10 before | Expand all | Expand 10 after
761 // Calling watchPosition should trigger the last usage update. 761 // Calling watchPosition should trigger the last usage update.
762 WatchPositionAndObservePermissionBubble(false); 762 WatchPositionAndObservePermissionBubble(false);
763 ExpectPosition(fake_latitude(), fake_longitude()); 763 ExpectPosition(fake_latitude(), fake_longitude());
764 764
765 // Last usage has been updated. 765 // Last usage has been updated.
766 EXPECT_EQ(GetHostContentSettingsMap()->GetLastUsage( 766 EXPECT_EQ(GetHostContentSettingsMap()->GetLastUsage(
767 current_url().GetOrigin(), 767 current_url().GetOrigin(),
768 current_url().GetOrigin(), 768 current_url().GetOrigin(),
769 CONTENT_SETTINGS_TYPE_GEOLOCATION).ToDoubleT(), 13); 769 CONTENT_SETTINGS_TYPE_GEOLOCATION).ToDoubleT(), 13);
770 } 770 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698