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" |
16 #include "chrome/test/base/ui_test_utils.h" | 17 #include "chrome/test/base/ui_test_utils.h" |
17 #include "content/public/browser/notification_service.h" | 18 #include "content/public/browser/notification_service.h" |
18 #include "content/public/browser/render_process_host.h" | 19 #include "content/public/browser/render_process_host.h" |
19 #include "content/public/browser/web_contents_delegate.h" | 20 #include "content/public/browser/web_contents_delegate.h" |
20 #include "content/public/test/browser_test_utils.h" | 21 #include "content/public/test/browser_test_utils.h" |
21 #include "content/public/test/fake_speech_recognition_manager.h" | 22 #include "content/public/test/fake_speech_recognition_manager.h" |
22 #include "net/test/embedded_test_server/embedded_test_server.h" | 23 #include "net/test/embedded_test_server/embedded_test_server.h" |
23 #include "net/test/embedded_test_server/http_request.h" | 24 #include "net/test/embedded_test_server/http_request.h" |
24 #include "net/test/embedded_test_server/http_response.h" | 25 #include "net/test/embedded_test_server/http_response.h" |
| 26 #include "ui/compositor/compositor_setup.h" |
25 #include "ui/gl/gl_switches.h" | 27 #include "ui/gl/gl_switches.h" |
26 | 28 |
27 // For fine-grained suppression on flaky tests. | 29 // For fine-grained suppression on flaky tests. |
28 #if defined(OS_WIN) | 30 #if defined(OS_WIN) |
29 #include "base/win/windows_version.h" | 31 #include "base/win/windows_version.h" |
30 #endif | 32 #endif |
31 | 33 |
32 using prerender::PrerenderLinkManager; | 34 using prerender::PrerenderLinkManager; |
33 using prerender::PrerenderLinkManagerFactory; | 35 using prerender::PrerenderLinkManagerFactory; |
34 | 36 |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 bool expect_allow_; | 143 bool expect_allow_; |
142 bool decision_made_; | 144 bool decision_made_; |
143 bool last_download_allowed_; | 145 bool last_download_allowed_; |
144 scoped_refptr<content::MessageLoopRunner> message_loop_runner_; | 146 scoped_refptr<content::MessageLoopRunner> message_loop_runner_; |
145 | 147 |
146 DISALLOW_COPY_AND_ASSIGN(MockDownloadWebContentsDelegate); | 148 DISALLOW_COPY_AND_ASSIGN(MockDownloadWebContentsDelegate); |
147 }; | 149 }; |
148 | 150 |
149 class WebViewTest : public extensions::PlatformAppBrowserTest { | 151 class WebViewTest : public extensions::PlatformAppBrowserTest { |
150 protected: | 152 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 |
151 virtual void SetUp() OVERRIDE { | 162 virtual void SetUp() OVERRIDE { |
152 const testing::TestInfo* const test_info = | 163 const testing::TestInfo* const test_info = |
153 testing::UnitTest::GetInstance()->current_test_info(); | 164 testing::UnitTest::GetInstance()->current_test_info(); |
154 | 165 |
155 // SpeechRecognition test specific SetUp. | 166 // SpeechRecognition test specific SetUp. |
156 if (!strcmp(test_info->name(), "SpeechRecognition")) { | 167 if (!strcmp(test_info->name(), "SpeechRecognition")) { |
157 fake_speech_recognition_manager_.reset( | 168 fake_speech_recognition_manager_.reset( |
158 new content::FakeSpeechRecognitionManager()); | 169 new content::FakeSpeechRecognitionManager()); |
159 fake_speech_recognition_manager_->set_should_send_fake_response(true); | 170 fake_speech_recognition_manager_->set_should_send_fake_response(true); |
160 // Inject the fake manager factory so that the test result is returned to | 171 // Inject the fake manager factory so that the test result is returned to |
(...skipping 1277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1438 "DoneDialogTest.FAILED", | 1449 "DoneDialogTest.FAILED", |
1439 "web_view/dialog"); | 1450 "web_view/dialog"); |
1440 } | 1451 } |
1441 | 1452 |
1442 IN_PROC_BROWSER_TEST_F(WebViewTest, Dialog_TestPromptDialog) { | 1453 IN_PROC_BROWSER_TEST_F(WebViewTest, Dialog_TestPromptDialog) { |
1443 TestHelper("testPromptDialog", | 1454 TestHelper("testPromptDialog", |
1444 "DoneDialogTest.PASSED", | 1455 "DoneDialogTest.PASSED", |
1445 "DoneDialogTest.FAILED", | 1456 "DoneDialogTest.FAILED", |
1446 "web_view/dialog"); | 1457 "web_view/dialog"); |
1447 } | 1458 } |
OLD | NEW |