OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "content/public/test/content_browser_test.h" | 5 #include "content/public/test/content_browser_test.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/location.h" | |
9 #include "base/single_thread_task_runner.h" | |
10 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
11 #include "base/thread_task_runner_handle.h" | |
12 #include "content/public/common/content_switches.h" | 9 #include "content/public/common/content_switches.h" |
13 #include "content/public/test/browser_test_utils.h" | 10 #include "content/public/test/browser_test_utils.h" |
14 #include "content/public/test/content_browser_test_utils.h" | 11 #include "content/public/test/content_browser_test_utils.h" |
15 #include "content/public/test/test_utils.h" | 12 #include "content/public/test/test_utils.h" |
16 #include "content/shell/browser/shell.h" | 13 #include "content/shell/browser/shell.h" |
17 #include "testing/gtest/include/gtest/gtest.h" | 14 #include "testing/gtest/include/gtest/gtest.h" |
18 | 15 |
19 namespace content { | 16 namespace content { |
20 | 17 |
21 IN_PROC_BROWSER_TEST_F(ContentBrowserTest, MANUAL_ShouldntRun) { | 18 IN_PROC_BROWSER_TEST_F(ContentBrowserTest, MANUAL_ShouldntRun) { |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 namespace { | 51 namespace { |
55 | 52 |
56 void CallbackChecker(bool* non_nested_task_ran) { | 53 void CallbackChecker(bool* non_nested_task_ran) { |
57 *non_nested_task_ran = true; | 54 *non_nested_task_ran = true; |
58 } | 55 } |
59 | 56 |
60 } // namespace | 57 } // namespace |
61 | 58 |
62 IN_PROC_BROWSER_TEST_F(ContentBrowserTestSanityTest, NonNestableTask) { | 59 IN_PROC_BROWSER_TEST_F(ContentBrowserTestSanityTest, NonNestableTask) { |
63 bool non_nested_task_ran = false; | 60 bool non_nested_task_ran = false; |
64 base::ThreadTaskRunnerHandle::Get()->PostNonNestableTask( | 61 base::MessageLoop::current()->PostNonNestableTask( |
65 FROM_HERE, base::Bind(&CallbackChecker, &non_nested_task_ran)); | 62 FROM_HERE, base::Bind(&CallbackChecker, &non_nested_task_ran)); |
66 content::RunAllPendingInMessageLoop(); | 63 content::RunAllPendingInMessageLoop(); |
67 ASSERT_TRUE(non_nested_task_ran); | 64 ASSERT_TRUE(non_nested_task_ran); |
68 } | 65 } |
69 | 66 |
70 } // namespace content | 67 } // namespace content |
OLD | NEW |