summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoroshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-17 01:31:40 +0000
committeroshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-17 01:31:40 +0000
commit9cf55753ab992ea9716c5acb82ec198c50a7fa69 (patch)
treedd9fcecb9a0406f17893d57a3ddf2847c3a53b08
parent5aeeafb93d440ad91b9b46b01478366962d44ffa (diff)
downloadchromium_src-9cf55753ab992ea9716c5acb82ec198c50a7fa69.zip
chromium_src-9cf55753ab992ea9716c5acb82ec198c50a7fa69.tar.gz
chromium_src-9cf55753ab992ea9716c5acb82ec198c50a7fa69.tar.bz2
Use WaitForNotification instead of busy loop.
BUG=none TEST=none Review URL: http://codereview.chromium.org/2943006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@52794 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/chromeos/network_state_notifier_browsertest.cc11
1 files changed, 3 insertions, 8 deletions
diff --git a/chrome/browser/chromeos/network_state_notifier_browsertest.cc b/chrome/browser/chromeos/network_state_notifier_browsertest.cc
index b917413..520dbcf 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) {