| 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/test/content_browser_test.h" | 5 #include "content/test/content_browser_test.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/file_path.h" | 8 #include "base/file_path.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 BrowserTestBase::SetUp(); | 86 BrowserTestBase::SetUp(); |
| 87 } | 87 } |
| 88 | 88 |
| 89 void ContentBrowserTest::TearDown() { | 89 void ContentBrowserTest::TearDown() { |
| 90 BrowserTestBase::TearDown(); | 90 BrowserTestBase::TearDown(); |
| 91 | 91 |
| 92 shell_main_delegate_.reset(); | 92 shell_main_delegate_.reset(); |
| 93 } | 93 } |
| 94 | 94 |
| 95 void ContentBrowserTest::RunTestOnMainThreadLoop() { | 95 void ContentBrowserTest::RunTestOnMainThreadLoop() { |
| 96 CHECK_EQ(Shell::windows().size(), 1u); | 96 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kDumpRenderTree)) { |
| 97 shell_ = Shell::windows()[0]; | 97 CHECK_EQ(Shell::windows().size(), 1u); |
| 98 shell_ = Shell::windows()[0]; |
| 99 } |
| 98 | 100 |
| 99 #if defined(OS_MACOSX) | 101 #if defined(OS_MACOSX) |
| 100 // On Mac, without the following autorelease pool, code which is directly | 102 // On Mac, without the following autorelease pool, code which is directly |
| 101 // executed (as opposed to executed inside a message loop) would autorelease | 103 // executed (as opposed to executed inside a message loop) would autorelease |
| 102 // objects into a higher-level pool. This pool is not recycled in-sync with | 104 // objects into a higher-level pool. This pool is not recycled in-sync with |
| 103 // the message loops' pools and causes problems with code relying on | 105 // the message loops' pools and causes problems with code relying on |
| 104 // deallocation via an autorelease pool (such as browser window closure and | 106 // deallocation via an autorelease pool (such as browser window closure and |
| 105 // browser shutdown). To avoid this, the following pool is recycled after each | 107 // browser shutdown). To avoid this, the following pool is recycled after each |
| 106 // time code is directly executed. | 108 // time code is directly executed. |
| 107 base::mac::ScopedNSAutoreleasePool pool; | 109 base::mac::ScopedNSAutoreleasePool pool; |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 static_cast<ShellContentBrowserClient*>(GetContentClient()->browser()); | 147 static_cast<ShellContentBrowserClient*>(GetContentClient()->browser()); |
| 146 return Shell::CreateNewWindow( | 148 return Shell::CreateNewWindow( |
| 147 browser_client->off_the_record_browser_context(), | 149 browser_client->off_the_record_browser_context(), |
| 148 GURL(chrome::kAboutBlankURL), | 150 GURL(chrome::kAboutBlankURL), |
| 149 NULL, | 151 NULL, |
| 150 MSG_ROUTING_NONE, | 152 MSG_ROUTING_NONE, |
| 151 NULL); | 153 NULL); |
| 152 } | 154 } |
| 153 | 155 |
| 154 } // namespace content | 156 } // namespace content |
| OLD | NEW |