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

Unified Diff: chrome/browser/ui/views/toolbar/reload_button_unittest.cc

Issue 1492423003: Rejigger ThemeService: move exposure of ThemeProvider interface to a (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix that unittest Created 5 years 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
Index: chrome/browser/ui/views/toolbar/reload_button_unittest.cc
diff --git a/chrome/browser/ui/views/toolbar/reload_button_unittest.cc b/chrome/browser/ui/views/toolbar/reload_button_unittest.cc
index 87579af18f913baae1ea9849a8f6a0b8910f9a94..00abdb0aa31382d9a2e595fbf06f2bb116594a1a 100644
--- a/chrome/browser/ui/views/toolbar/reload_button_unittest.cc
+++ b/chrome/browser/ui/views/toolbar/reload_button_unittest.cc
@@ -4,10 +4,12 @@
#include "base/message_loop/message_loop.h"
#include "chrome/browser/ui/views/toolbar/reload_button.h"
+#include "chrome/test/base/chrome_render_view_host_test_harness.h"
+#include "chrome/test/base/testing_profile.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/events/event_utils.h"
-class ReloadButtonTest : public testing::Test {
+class ReloadButtonTest : public ChromeRenderViewHostTestHarness {
public:
ReloadButtonTest();
@@ -24,13 +26,10 @@ class ReloadButtonTest : public testing::Test {
int reload_count() { return reload_.testing_reload_count_; }
protected:
- // We need a message loop for the timers to post events.
- base::MessageLoop loop_;
-
ReloadButton reload_;
};
-ReloadButtonTest::ReloadButtonTest() : reload_(NULL) {
+ReloadButtonTest::ReloadButtonTest() : reload_(profile(), nullptr) {
// Set the timer delays to 0 so that timers will fire as soon as we tell the
// message loop to run pending tasks.
reload_.double_click_timer_delay_ = base::TimeDelta();
@@ -98,7 +97,7 @@ TEST_F(ReloadButtonTest, DoubleClickTimer) {
false);
// Now fire the timer. This should complete the mode change.
- loop_.RunUntilIdle();
+ base::MessageLoop::current()->RunUntilIdle();
CheckState(true, ReloadButton::MODE_STOP, ReloadButton::MODE_STOP, false,
false);
}
@@ -151,7 +150,7 @@ TEST_F(ReloadButtonTest, ResetOnTimer) {
reload_.ChangeMode(ReloadButton::MODE_RELOAD, false);
// Now fire the stop-to-reload timer. This should reset the button.
- loop_.RunUntilIdle();
+ base::MessageLoop::current()->RunUntilIdle();
CheckState(true, ReloadButton::MODE_RELOAD, ReloadButton::MODE_RELOAD, false,
false);
}
« no previous file with comments | « chrome/browser/ui/views/toolbar/reload_button.cc ('k') | chrome/browser/ui/views/toolbar/toolbar_action_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698