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/files/file_path.h" | 8 #include "base/files/file_path.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
11 #include "base/path_service.h" | 11 #include "base/path_service.h" |
| 12 #include "base/run_loop.h" |
12 #include "base/threading/thread_restrictions.h" | 13 #include "base/threading/thread_restrictions.h" |
13 #include "build/build_config.h" | 14 #include "build/build_config.h" |
14 #include "content/public/browser/render_process_host.h" | 15 #include "content/public/browser/render_process_host.h" |
15 #include "content/public/common/content_paths.h" | 16 #include "content/public/common/content_paths.h" |
16 #include "content/public/common/content_switches.h" | 17 #include "content/public/common/content_switches.h" |
17 #include "content/public/common/url_constants.h" | 18 #include "content/public/common/url_constants.h" |
18 #include "content/shell/browser/shell.h" | 19 #include "content/shell/browser/shell.h" |
19 #include "content/shell/browser/shell_browser_context.h" | 20 #include "content/shell/browser/shell_browser_context.h" |
20 #include "content/shell/browser/shell_content_browser_client.h" | 21 #include "content/shell/browser/shell_content_browser_client.h" |
21 #include "content/shell/common/shell_switches.h" | 22 #include "content/shell/common/shell_switches.h" |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 // executed (as opposed to executed inside a message loop) would autorelease | 118 // executed (as opposed to executed inside a message loop) would autorelease |
118 // objects into a higher-level pool. This pool is not recycled in-sync with | 119 // objects into a higher-level pool. This pool is not recycled in-sync with |
119 // the message loops' pools and causes problems with code relying on | 120 // the message loops' pools and causes problems with code relying on |
120 // deallocation via an autorelease pool (such as browser window closure and | 121 // deallocation via an autorelease pool (such as browser window closure and |
121 // browser shutdown). To avoid this, the following pool is recycled after each | 122 // browser shutdown). To avoid this, the following pool is recycled after each |
122 // time code is directly executed. | 123 // time code is directly executed. |
123 base::mac::ScopedNSAutoreleasePool pool; | 124 base::mac::ScopedNSAutoreleasePool pool; |
124 #endif | 125 #endif |
125 | 126 |
126 // Pump startup related events. | 127 // Pump startup related events. |
127 base::MessageLoopForUI::current()->RunUntilIdle(); | 128 DCHECK(base::MessageLoopForUI::IsCurrent()); |
| 129 base::RunLoop().RunUntilIdle(); |
128 | 130 |
129 #if defined(OS_MACOSX) | 131 #if defined(OS_MACOSX) |
130 pool.Recycle(); | 132 pool.Recycle(); |
131 #endif | 133 #endif |
132 | 134 |
133 SetUpOnMainThread(); | 135 SetUpOnMainThread(); |
134 | 136 |
135 bool old_io_allowed_value = base::ThreadRestrictions::SetIOAllowed(false); | 137 bool old_io_allowed_value = base::ThreadRestrictions::SetIOAllowed(false); |
136 RunTestOnMainThread(); | 138 RunTestOnMainThread(); |
137 base::ThreadRestrictions::SetIOAllowed(old_io_allowed_value); | 139 base::ThreadRestrictions::SetIOAllowed(old_io_allowed_value); |
(...skipping 21 matching lines...) Expand all Loading... |
159 | 161 |
160 Shell* ContentBrowserTest::CreateOffTheRecordBrowser() { | 162 Shell* ContentBrowserTest::CreateOffTheRecordBrowser() { |
161 return Shell::CreateNewWindow( | 163 return Shell::CreateNewWindow( |
162 ShellContentBrowserClient::Get()->off_the_record_browser_context(), | 164 ShellContentBrowserClient::Get()->off_the_record_browser_context(), |
163 GURL(url::kAboutBlankURL), | 165 GURL(url::kAboutBlankURL), |
164 NULL, | 166 NULL, |
165 gfx::Size()); | 167 gfx::Size()); |
166 } | 168 } |
167 | 169 |
168 } // namespace content | 170 } // namespace content |
OLD | NEW |