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 <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 Loading... |
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 Loading... |
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 } |
OLD | NEW |