| 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/threading/thread_restrictions.h" |
| 12 #include "build/build_config.h" | 13 #include "build/build_config.h" |
| 13 #include "content/public/browser/render_process_host.h" | 14 #include "content/public/browser/render_process_host.h" |
| 14 #include "content/public/common/content_paths.h" | 15 #include "content/public/common/content_paths.h" |
| 15 #include "content/public/common/content_switches.h" | 16 #include "content/public/common/content_switches.h" |
| 16 #include "content/public/common/url_constants.h" | 17 #include "content/public/common/url_constants.h" |
| 17 #include "content/shell/browser/shell.h" | 18 #include "content/shell/browser/shell.h" |
| 18 #include "content/shell/browser/shell_browser_context.h" | 19 #include "content/shell/browser/shell_browser_context.h" |
| 19 #include "content/shell/browser/shell_content_browser_client.h" | 20 #include "content/shell/browser/shell_content_browser_client.h" |
| 20 #include "content/shell/common/shell_switches.h" | 21 #include "content/shell/common/shell_switches.h" |
| 21 #include "content/shell/renderer/layout_test/layout_test_content_renderer_client
.h" | 22 #include "content/shell/renderer/layout_test/layout_test_content_renderer_client
.h" |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 | 125 |
| 125 // Pump startup related events. | 126 // Pump startup related events. |
| 126 base::MessageLoopForUI::current()->RunUntilIdle(); | 127 base::MessageLoopForUI::current()->RunUntilIdle(); |
| 127 | 128 |
| 128 #if defined(OS_MACOSX) | 129 #if defined(OS_MACOSX) |
| 129 pool.Recycle(); | 130 pool.Recycle(); |
| 130 #endif | 131 #endif |
| 131 | 132 |
| 132 SetUpOnMainThread(); | 133 SetUpOnMainThread(); |
| 133 | 134 |
| 135 bool old_io_allowed_value = base::ThreadRestrictions::SetIOAllowed(false); |
| 134 RunTestOnMainThread(); | 136 RunTestOnMainThread(); |
| 137 base::ThreadRestrictions::SetIOAllowed(old_io_allowed_value); |
| 135 | 138 |
| 136 TearDownOnMainThread(); | 139 TearDownOnMainThread(); |
| 137 #if defined(OS_MACOSX) | 140 #if defined(OS_MACOSX) |
| 138 pool.Recycle(); | 141 pool.Recycle(); |
| 139 #endif | 142 #endif |
| 140 | 143 |
| 141 for (RenderProcessHost::iterator i(RenderProcessHost::AllHostsIterator()); | 144 for (RenderProcessHost::iterator i(RenderProcessHost::AllHostsIterator()); |
| 142 !i.IsAtEnd(); i.Advance()) { | 145 !i.IsAtEnd(); i.Advance()) { |
| 143 i.GetCurrentValue()->FastShutdownIfPossible(); | 146 i.GetCurrentValue()->FastShutdownIfPossible(); |
| 144 } | 147 } |
| (...skipping 11 matching lines...) Expand all Loading... |
| 156 | 159 |
| 157 Shell* ContentBrowserTest::CreateOffTheRecordBrowser() { | 160 Shell* ContentBrowserTest::CreateOffTheRecordBrowser() { |
| 158 return Shell::CreateNewWindow( | 161 return Shell::CreateNewWindow( |
| 159 ShellContentBrowserClient::Get()->off_the_record_browser_context(), | 162 ShellContentBrowserClient::Get()->off_the_record_browser_context(), |
| 160 GURL(url::kAboutBlankURL), | 163 GURL(url::kAboutBlankURL), |
| 161 NULL, | 164 NULL, |
| 162 gfx::Size()); | 165 gfx::Size()); |
| 163 } | 166 } |
| 164 | 167 |
| 165 } // namespace content | 168 } // namespace content |
| OLD | NEW |