Index: ui/base/test/scoped_fake_nswindow_fullscreen.mm |
diff --git a/ui/base/test/scoped_fake_nswindow_fullscreen.mm b/ui/base/test/scoped_fake_nswindow_fullscreen.mm |
index 0dc9db7d262c699dba8bde548c3392d8520d37ea..c98641fc8e916f939970a82fb67ce1ab6c0bf81c 100644 |
--- a/ui/base/test/scoped_fake_nswindow_fullscreen.mm |
+++ b/ui/base/test/scoped_fake_nswindow_fullscreen.mm |
@@ -15,6 +15,7 @@ |
#include "base/macros.h" |
#include "base/message_loop/message_loop.h" |
#include "base/run_loop.h" |
+#include "base/threading/thread_task_runner_handle.h" |
// This method exists on NSWindowDelegate on 10.7+. |
// To build on 10.6, we just need to declare it somewhere. We'll test |
@@ -116,7 +117,8 @@ class ScopedFakeNSWindowFullscreen::Impl { |
[[NSNotificationCenter defaultCenter] |
postNotificationName:NSWindowWillStartLiveResizeNotification |
object:window]; |
- base::MessageLoopForUI::current()->PostTask( |
+ DCHECK(base::MessageLoopForUI::IsCurrent()); |
+ base::ThreadTaskRunnerHandle::Get()->PostTask( |
FROM_HERE, base::Bind(&Impl::FinishEnterFullscreen, |
base::Unretained(this), fullscreen_content_size)); |
} |
@@ -154,7 +156,8 @@ class ScopedFakeNSWindowFullscreen::Impl { |
postNotificationName:NSWindowWillExitFullScreenNotification |
object:window_]; |
- base::MessageLoopForUI::current()->PostTask( |
+ DCHECK(base::MessageLoopForUI::IsCurrent()); |
+ base::ThreadTaskRunnerHandle::Get()->PostTask( |
FROM_HERE, |
base::Bind(&Impl::FinishExitFullscreen, base::Unretained(this))); |
} |