OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 <set> | 5 #include <set> |
6 | 6 |
7 #include "base/run_loop.h" | 7 #include "base/run_loop.h" |
8 #include "base/strings/string_number_conversions.h" | 8 #include "base/strings/string_number_conversions.h" |
9 #include "chrome/browser/extensions/extension_browsertest.h" | 9 #include "chrome/browser/extensions/extension_browsertest.h" |
10 #include "chrome/browser/extensions/extension_service.h" | 10 #include "chrome/browser/extensions/extension_service.h" |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 waiting_ = false; | 57 waiting_ = false; |
58 return HasReceivedNotification(); | 58 return HasReceivedNotification(); |
59 } | 59 } |
60 | 60 |
61 private: | 61 private: |
62 // MessageCenterObserver implementation: | 62 // MessageCenterObserver implementation: |
63 void OnNotificationAdded(const std::string& notification_id) override { | 63 void OnNotificationAdded(const std::string& notification_id) override { |
64 received_notifications_.insert(notification_id); | 64 received_notifications_.insert(notification_id); |
65 | 65 |
66 if (waiting_ && HasReceivedNotification()) | 66 if (waiting_ && HasReceivedNotification()) |
67 base::MessageLoopForUI::current()->Quit(); | 67 base::MessageLoopForUI::current()->QuitWhenIdle(); |
68 } | 68 } |
69 | 69 |
70 message_center::MessageCenter* message_center_; | 70 message_center::MessageCenter* message_center_; |
71 std::set<std::string> received_notifications_; | 71 std::set<std::string> received_notifications_; |
72 std::string target_notification_id_; | 72 std::string target_notification_id_; |
73 bool waiting_; | 73 bool waiting_; |
74 }; | 74 }; |
75 | 75 |
76 } // namespace | 76 } // namespace |
77 | 77 |
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
328 ScopedTestDialogAutoConfirm::ACCEPT); | 328 ScopedTestDialogAutoConfirm::ACCEPT); |
329 TestExtensionRegistryObserver observer(ExtensionRegistry::Get(profile()), | 329 TestExtensionRegistryObserver observer(ExtensionRegistry::Get(profile()), |
330 extension->id()); | 330 extension->id()); |
331 message_center::MessageCenter::Get()->ClickOnNotificationButton( | 331 message_center::MessageCenter::Get()->ClickOnNotificationButton( |
332 GetNotificationId(extension->id()), | 332 GetNotificationId(extension->id()), |
333 ExtensionStorageMonitor::BUTTON_UNINSTALL); | 333 ExtensionStorageMonitor::BUTTON_UNINSTALL); |
334 observer.WaitForExtensionUninstalled(); | 334 observer.WaitForExtensionUninstalled(); |
335 } | 335 } |
336 | 336 |
337 } // namespace extensions | 337 } // namespace extensions |
OLD | NEW |