OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "base/strings/stringprintf.h" | 5 #include "base/strings/stringprintf.h" |
6 #include "base/strings/utf_string_conversions.h" | 6 #include "base/strings/utf_string_conversions.h" |
7 #include "chrome/browser/automation/automation_util.h" | 7 #include "chrome/browser/automation/automation_util.h" |
8 #include "chrome/browser/extensions/extension_test_message_listener.h" | 8 #include "chrome/browser/extensions/extension_test_message_listener.h" |
9 #include "chrome/browser/extensions/platform_app_browsertest_util.h" | 9 #include "chrome/browser/extensions/platform_app_browsertest_util.h" |
10 #include "chrome/browser/prerender/prerender_link_manager.h" | 10 #include "chrome/browser/prerender/prerender_link_manager.h" |
11 #include "chrome/browser/prerender/prerender_link_manager_factory.h" | 11 #include "chrome/browser/prerender/prerender_link_manager_factory.h" |
12 #include "chrome/browser/profiles/profile.h" | 12 #include "chrome/browser/profiles/profile.h" |
13 #include "chrome/browser/ui/browser.h" | 13 #include "chrome/browser/ui/browser.h" |
14 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 14 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
15 #include "chrome/common/extensions/extension.h" | 15 #include "chrome/common/extensions/extension.h" |
16 #include "chrome/test/base/test_launcher_utils.h" | |
17 #include "chrome/test/base/ui_test_utils.h" | 16 #include "chrome/test/base/ui_test_utils.h" |
18 #include "content/public/browser/notification_service.h" | 17 #include "content/public/browser/notification_service.h" |
19 #include "content/public/browser/render_process_host.h" | 18 #include "content/public/browser/render_process_host.h" |
20 #include "content/public/browser/web_contents_delegate.h" | 19 #include "content/public/browser/web_contents_delegate.h" |
21 #include "content/public/test/browser_test_utils.h" | 20 #include "content/public/test/browser_test_utils.h" |
22 #include "content/public/test/fake_speech_recognition_manager.h" | 21 #include "content/public/test/fake_speech_recognition_manager.h" |
23 #include "net/test/embedded_test_server/embedded_test_server.h" | 22 #include "net/test/embedded_test_server/embedded_test_server.h" |
24 #include "net/test/embedded_test_server/http_request.h" | 23 #include "net/test/embedded_test_server/http_request.h" |
25 #include "net/test/embedded_test_server/http_response.h" | 24 #include "net/test/embedded_test_server/http_response.h" |
26 #include "ui/compositor/compositor_setup.h" | |
27 #include "ui/gl/gl_switches.h" | 25 #include "ui/gl/gl_switches.h" |
28 | 26 |
29 // For fine-grained suppression on flaky tests. | 27 // For fine-grained suppression on flaky tests. |
30 #if defined(OS_WIN) | 28 #if defined(OS_WIN) |
31 #include "base/win/windows_version.h" | 29 #include "base/win/windows_version.h" |
32 #endif | 30 #endif |
33 | 31 |
34 using prerender::PrerenderLinkManager; | 32 using prerender::PrerenderLinkManager; |
35 using prerender::PrerenderLinkManagerFactory; | 33 using prerender::PrerenderLinkManagerFactory; |
36 | 34 |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 bool expect_allow_; | 141 bool expect_allow_; |
144 bool decision_made_; | 142 bool decision_made_; |
145 bool last_download_allowed_; | 143 bool last_download_allowed_; |
146 scoped_refptr<content::MessageLoopRunner> message_loop_runner_; | 144 scoped_refptr<content::MessageLoopRunner> message_loop_runner_; |
147 | 145 |
148 DISALLOW_COPY_AND_ASSIGN(MockDownloadWebContentsDelegate); | 146 DISALLOW_COPY_AND_ASSIGN(MockDownloadWebContentsDelegate); |
149 }; | 147 }; |
150 | 148 |
151 class WebViewTest : public extensions::PlatformAppBrowserTest { | 149 class WebViewTest : public extensions::PlatformAppBrowserTest { |
152 protected: | 150 protected: |
153 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { | |
154 extensions::PlatformAppBrowserTest::SetUpCommandLine(command_line); | |
155 #if !defined(OS_MACOSX) | |
156 CHECK(test_launcher_utils::OverrideGLImplementation( | |
157 command_line, gfx::kGLImplementationOSMesaName)) << | |
158 "kUseGL must not be set by test framework code!"; | |
159 #endif | |
160 } | |
161 | |
162 virtual void SetUp() OVERRIDE { | 151 virtual void SetUp() OVERRIDE { |
163 const testing::TestInfo* const test_info = | 152 const testing::TestInfo* const test_info = |
164 testing::UnitTest::GetInstance()->current_test_info(); | 153 testing::UnitTest::GetInstance()->current_test_info(); |
165 | 154 |
166 // SpeechRecognition test specific SetUp. | 155 // SpeechRecognition test specific SetUp. |
167 if (!strcmp(test_info->name(), "SpeechRecognition")) { | 156 if (!strcmp(test_info->name(), "SpeechRecognition")) { |
168 fake_speech_recognition_manager_.reset( | 157 fake_speech_recognition_manager_.reset( |
169 new content::FakeSpeechRecognitionManager()); | 158 new content::FakeSpeechRecognitionManager()); |
170 fake_speech_recognition_manager_->set_should_send_fake_response(true); | 159 fake_speech_recognition_manager_->set_should_send_fake_response(true); |
171 // Inject the fake manager factory so that the test result is returned to | 160 // Inject the fake manager factory so that the test result is returned to |
(...skipping 1268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1440 "DoneDialogTest.FAILED", | 1429 "DoneDialogTest.FAILED", |
1441 "web_view/dialog"); | 1430 "web_view/dialog"); |
1442 } | 1431 } |
1443 | 1432 |
1444 IN_PROC_BROWSER_TEST_F(WebViewTest, Dialog_TestPromptDialog) { | 1433 IN_PROC_BROWSER_TEST_F(WebViewTest, Dialog_TestPromptDialog) { |
1445 TestHelper("testPromptDialog", | 1434 TestHelper("testPromptDialog", |
1446 "DoneDialogTest.PASSED", | 1435 "DoneDialogTest.PASSED", |
1447 "DoneDialogTest.FAILED", | 1436 "DoneDialogTest.FAILED", |
1448 "web_view/dialog"); | 1437 "web_view/dialog"); |
1449 } | 1438 } |
OLD | NEW |