Chromium Code Reviews| 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/run_loop.h" |
| 13 #include "base/threading/thread_restrictions.h" | 13 #include "base/threading/thread_restrictions.h" |
| 14 #include "build/build_config.h" | 14 #include "build/build_config.h" |
| 15 #include "content/public/browser/render_process_host.h" | 15 #include "content/public/browser/render_process_host.h" |
| 16 #include "content/public/common/content_paths.h" | 16 #include "content/public/common/content_paths.h" |
| 17 #include "content/public/common/content_switches.h" | 17 #include "content/public/common/content_switches.h" |
| 18 #include "content/public/common/url_constants.h" | 18 #include "content/public/common/url_constants.h" |
| 19 #include "content/shell/browser/shell.h" | 19 #include "content/shell/browser/shell.h" |
| 20 #include "content/shell/browser/shell_browser_context.h" | 20 #include "content/shell/browser/shell_browser_context.h" |
| 21 #include "content/shell/browser/shell_content_browser_client.h" | 21 #include "content/shell/browser/shell_content_browser_client.h" |
| 22 #include "content/shell/common/shell_switches.h" | 22 #include "content/shell/common/shell_switches.h" |
| 23 #include "content/shell/renderer/layout_test/layout_test_content_renderer_client .h" | 23 #include "content/shell/renderer/layout_test/layout_test_content_renderer_client .h" |
| 24 #include "content/test/test_content_client.h" | 24 #include "content/test/test_content_client.h" |
| 25 #include "ui/events/event_switches.h" | |
| 25 | 26 |
| 26 #if defined(OS_ANDROID) | 27 #if defined(OS_ANDROID) |
| 27 #include "content/shell/app/shell_main_delegate.h" | 28 #include "content/shell/app/shell_main_delegate.h" |
| 28 #endif | 29 #endif |
| 29 | 30 |
| 30 #if defined(OS_MACOSX) | 31 #if defined(OS_MACOSX) |
| 31 #include "base/mac/scoped_nsautorelease_pool.h" | 32 #include "base/mac/scoped_nsautorelease_pool.h" |
| 32 #endif | 33 #endif |
| 33 | 34 |
| 34 #if !defined(OS_CHROMEOS) && defined(OS_LINUX) | 35 #if !defined(OS_CHROMEOS) && defined(OS_LINUX) |
| (...skipping 15 matching lines...) Expand all Loading... | |
| 50 base::FilePath content_test_data(FILE_PATH_LITERAL("content/test/data")); | 51 base::FilePath content_test_data(FILE_PATH_LITERAL("content/test/data")); |
| 51 CreateTestServer(content_test_data); | 52 CreateTestServer(content_test_data); |
| 52 } | 53 } |
| 53 | 54 |
| 54 ContentBrowserTest::~ContentBrowserTest() { | 55 ContentBrowserTest::~ContentBrowserTest() { |
| 55 } | 56 } |
| 56 | 57 |
| 57 void ContentBrowserTest::SetUp() { | 58 void ContentBrowserTest::SetUp() { |
| 58 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); | 59 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); |
| 59 command_line->AppendSwitch(switches::kContentBrowserTest); | 60 command_line->AppendSwitch(switches::kContentBrowserTest); |
| 61 command_line->AppendSwitch(switches::kTouchEvents); | |
|
sadrul
2016/11/30 20:53:13
This affects all tests. Are you sure you want to s
| |
| 60 | 62 |
| 61 SetUpCommandLine(command_line); | 63 SetUpCommandLine(command_line); |
| 62 | 64 |
| 63 #if defined(OS_ANDROID) | 65 #if defined(OS_ANDROID) |
| 64 shell_main_delegate_.reset(new ShellMainDelegate); | 66 shell_main_delegate_.reset(new ShellMainDelegate); |
| 65 shell_main_delegate_->PreSandboxStartup(); | 67 shell_main_delegate_->PreSandboxStartup(); |
| 66 if (command_line->HasSwitch(switches::kSingleProcess)) { | 68 if (command_line->HasSwitch(switches::kSingleProcess)) { |
| 67 // We explicitly leak the new ContentRendererClient as we're | 69 // We explicitly leak the new ContentRendererClient as we're |
| 68 // setting a global that may be used after ContentBrowserTest is | 70 // setting a global that may be used after ContentBrowserTest is |
| 69 // destroyed. | 71 // destroyed. |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 161 | 163 |
| 162 Shell* ContentBrowserTest::CreateOffTheRecordBrowser() { | 164 Shell* ContentBrowserTest::CreateOffTheRecordBrowser() { |
| 163 return Shell::CreateNewWindow( | 165 return Shell::CreateNewWindow( |
| 164 ShellContentBrowserClient::Get()->off_the_record_browser_context(), | 166 ShellContentBrowserClient::Get()->off_the_record_browser_context(), |
| 165 GURL(url::kAboutBlankURL), | 167 GURL(url::kAboutBlankURL), |
| 166 NULL, | 168 NULL, |
| 167 gfx::Size()); | 169 gfx::Size()); |
| 168 } | 170 } |
| 169 | 171 |
| 170 } // namespace content | 172 } // namespace content |
| OLD | NEW |