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

Unified Diff: chrome/browser/chromeos/network_state_notifier_browsertest.cc

Issue 2943006: Use WaitForNotification instead of busy loop. (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: " Created 10 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/network_state_notifier_browsertest.cc
diff --git a/chrome/browser/chromeos/network_state_notifier_browsertest.cc b/chrome/browser/chromeos/network_state_notifier_browsertest.cc
index b9174137cca81163b05692440cb5d5840fa58dfe..520dbcfde235a2e6718702d3ded72fb523b45453 100644
--- a/chrome/browser/chromeos/network_state_notifier_browsertest.cc
+++ b/chrome/browser/chromeos/network_state_notifier_browsertest.cc
@@ -21,8 +21,7 @@ using ::testing::_;
class NetworkStateNotifierTest : public CrosInProcessBrowserTest,
public NotificationObserver {
public:
- NetworkStateNotifierTest()
- : notification_received_(false) {
+ NetworkStateNotifierTest() {
}
protected:
@@ -48,19 +47,15 @@ class NetworkStateNotifierTest : public CrosInProcessBrowserTest,
chromeos::NetworkStateDetails* state_details =
Details<chromeos::NetworkStateDetails>(details).ptr();
state_ = state_details->state();
- notification_received_ = true;
}
void WaitForNotification() {
- notification_received_ = false;
- while (!notification_received_) {
- ui_test_utils::RunAllPendingInMessageLoop();
- }
+ ui_test_utils::WaitForNotification(
+ NotificationType::NETWORK_STATE_CHANGED);
}
protected:
NetworkStateDetails::State state_;
- bool notification_received_;
};
IN_PROC_BROWSER_TEST_F(NetworkStateNotifierTest, TestConnected) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698