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

Unified Diff: content/test/content_browser_test_test.cc

Issue 733533002: Do not start RunLoop of MessagePumpForUI in NestedMessagePumpAndroid (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use anonymous namespace for CallbackChecker Created 6 years, 1 month 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 | « content/public/test/nested_message_pump_android.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/test/content_browser_test_test.cc
diff --git a/content/test/content_browser_test_test.cc b/content/test/content_browser_test_test.cc
index 42a89013db258e7641e3887121483df30e2cd6b7..cba31c8bc6144e87170b9bb6f23463fb153777bc 100644
--- a/content/test/content_browser_test_test.cc
+++ b/content/test/content_browser_test_test.cc
@@ -9,6 +9,7 @@
#include "content/public/common/content_switches.h"
#include "content/public/test/browser_test_utils.h"
#include "content/public/test/content_browser_test_utils.h"
+#include "content/public/test/test_utils.h"
#include "content/shell/browser/shell.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -47,4 +48,20 @@ IN_PROC_BROWSER_TEST_F(ContentBrowserTestSanityTest, SingleProcess) {
Test();
}
+namespace {
+
+void CallbackChecker(bool* non_nested_task_ran) {
+ *non_nested_task_ran = true;
+}
+
+} // namespace
+
+IN_PROC_BROWSER_TEST_F(ContentBrowserTestSanityTest, NonNestableTask) {
+ bool non_nested_task_ran = false;
+ base::MessageLoop::current()->PostNonNestableTask(
+ FROM_HERE, base::Bind(&CallbackChecker, &non_nested_task_ran));
+ content::RunAllPendingInMessageLoop();
+ ASSERT_TRUE(non_nested_task_ran);
+}
+
} // namespace content
« no previous file with comments | « content/public/test/nested_message_pump_android.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698