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

Unified Diff: chrome/browser/ui/views/frame/web_contents_close_handler_unittest.cc

Issue 2851593002: Use ScopedTaskEnvironment instead of MessageLoopForUI in chrome tests. (Closed)
Patch Set: fix-build-error Created 3 years, 8 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 | « chrome/browser/ui/omnibox/clipboard_utils_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/frame/web_contents_close_handler_unittest.cc
diff --git a/chrome/browser/ui/views/frame/web_contents_close_handler_unittest.cc b/chrome/browser/ui/views/frame/web_contents_close_handler_unittest.cc
index 0ff0896f95c0676ce0005b2e0b53d3549330f19e..950e5f10a63a906dd1964cff6637ef1670c48e1b 100644
--- a/chrome/browser/ui/views/frame/web_contents_close_handler_unittest.cc
+++ b/chrome/browser/ui/views/frame/web_contents_close_handler_unittest.cc
@@ -5,7 +5,7 @@
#include "chrome/browser/ui/views/frame/web_contents_close_handler.h"
#include "base/macros.h"
-#include "base/message_loop/message_loop.h"
+#include "base/test/scoped_task_environment.h"
#include "chrome/browser/ui/views/frame/web_contents_close_handler_delegate.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -13,9 +13,10 @@ class MockWebContentsCloseHandlerDelegate
: public WebContentsCloseHandlerDelegate {
public:
explicit MockWebContentsCloseHandlerDelegate()
- : got_clone_(false),
- got_destroy_(false) {
- }
+ : scoped_task_environment_(
+ base::test::ScopedTaskEnvironment::MainThreadType::UI),
+ got_clone_(false),
+ got_destroy_(false) {}
~MockWebContentsCloseHandlerDelegate() override {}
void Clear() {
@@ -33,7 +34,7 @@ class MockWebContentsCloseHandlerDelegate
void DestroyClonedLayer() override { got_destroy_ = true; }
private:
- base::MessageLoopForUI message_loop_;
+ base::test::ScopedTaskEnvironment scoped_task_environment_;
bool got_clone_;
bool got_destroy_;
@@ -90,4 +91,3 @@ TEST_F(WebContentsCloseHandlerTest, DontDestroyImmediatleyAfterCancel) {
EXPECT_FALSE(close_handler_delegate_.got_clone());
EXPECT_TRUE(IsTimerRunning());
}
-
« no previous file with comments | « chrome/browser/ui/omnibox/clipboard_utils_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698