| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "apps/ui/native_app_window.h" | 5 #include "apps/ui/native_app_window.h" |
| 6 #include "base/path_service.h" | 6 #include "base/path_service.h" |
| 7 #include "base/strings/stringprintf.h" | 7 #include "base/strings/stringprintf.h" |
| 8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
| 9 #include "chrome/browser/apps/app_browsertest_util.h" | 9 #include "chrome/browser/apps/app_browsertest_util.h" |
| 10 #include "chrome/browser/automation/automation_util.h" | 10 #include "chrome/browser/automation/automation_util.h" |
| (...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 442 *persistent_partition_contents2 = source6->GetWebContents(); | 442 *persistent_partition_contents2 = source6->GetWebContents(); |
| 443 } | 443 } |
| 444 if (persistent_partition_contents3) { | 444 if (persistent_partition_contents3) { |
| 445 *persistent_partition_contents3 = source7->GetWebContents(); | 445 *persistent_partition_contents3 = source7->GetWebContents(); |
| 446 } | 446 } |
| 447 } | 447 } |
| 448 | 448 |
| 449 void ExecuteScriptWaitForTitle(content::WebContents* web_contents, | 449 void ExecuteScriptWaitForTitle(content::WebContents* web_contents, |
| 450 const char* script, | 450 const char* script, |
| 451 const char* title) { | 451 const char* title) { |
| 452 base::string16 expected_title(ASCIIToUTF16(title)); | 452 base::string16 expected_title(base::ASCIIToUTF16(title)); |
| 453 base::string16 error_title(ASCIIToUTF16("error")); | 453 base::string16 error_title(base::ASCIIToUTF16("error")); |
| 454 | 454 |
| 455 content::TitleWatcher title_watcher(web_contents, expected_title); | 455 content::TitleWatcher title_watcher(web_contents, expected_title); |
| 456 title_watcher.AlsoWaitForTitle(error_title); | 456 title_watcher.AlsoWaitForTitle(error_title); |
| 457 EXPECT_TRUE(content::ExecuteScript(web_contents, script)); | 457 EXPECT_TRUE(content::ExecuteScript(web_contents, script)); |
| 458 EXPECT_EQ(expected_title, title_watcher.WaitAndGetTitle()); | 458 EXPECT_EQ(expected_title, title_watcher.WaitAndGetTitle()); |
| 459 } | 459 } |
| 460 | 460 |
| 461 // Handles |request| by serving a redirect response. | 461 // Handles |request| by serving a redirect response. |
| 462 static scoped_ptr<net::test_server::HttpResponse> RedirectResponseHandler( | 462 static scoped_ptr<net::test_server::HttpResponse> RedirectResponseHandler( |
| 463 const std::string& path, | 463 const std::string& path, |
| (...skipping 1081 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1545 ASSERT_TRUE(StartEmbeddedTestServer()); | 1545 ASSERT_TRUE(StartEmbeddedTestServer()); |
| 1546 content::WebContents* guest_web_contents = LoadGuest( | 1546 content::WebContents* guest_web_contents = LoadGuest( |
| 1547 "/extensions/platform_apps/web_view/speech/guest.html", | 1547 "/extensions/platform_apps/web_view/speech/guest.html", |
| 1548 "web_view/speech"); | 1548 "web_view/speech"); |
| 1549 ASSERT_TRUE(guest_web_contents); | 1549 ASSERT_TRUE(guest_web_contents); |
| 1550 | 1550 |
| 1551 // Click on the guest (center of the WebContents), the guest is rendered in a | 1551 // Click on the guest (center of the WebContents), the guest is rendered in a |
| 1552 // way that this will trigger clicking on speech recognition input mic. | 1552 // way that this will trigger clicking on speech recognition input mic. |
| 1553 SimulateMouseClick(guest_web_contents, 0, blink::WebMouseEvent::ButtonLeft); | 1553 SimulateMouseClick(guest_web_contents, 0, blink::WebMouseEvent::ButtonLeft); |
| 1554 | 1554 |
| 1555 base::string16 expected_title(ASCIIToUTF16("PASSED")); | 1555 base::string16 expected_title(base::ASCIIToUTF16("PASSED")); |
| 1556 base::string16 error_title(ASCIIToUTF16("FAILED")); | 1556 base::string16 error_title(base::ASCIIToUTF16("FAILED")); |
| 1557 content::TitleWatcher title_watcher(guest_web_contents, expected_title); | 1557 content::TitleWatcher title_watcher(guest_web_contents, expected_title); |
| 1558 title_watcher.AlsoWaitForTitle(error_title); | 1558 title_watcher.AlsoWaitForTitle(error_title); |
| 1559 EXPECT_EQ(expected_title, title_watcher.WaitAndGetTitle()); | 1559 EXPECT_EQ(expected_title, title_watcher.WaitAndGetTitle()); |
| 1560 } | 1560 } |
| 1561 | 1561 |
| 1562 // Flaky on Windows. http://crbug.com/303966 | 1562 // Flaky on Windows. http://crbug.com/303966 |
| 1563 #if defined(OS_WIN) | 1563 #if defined(OS_WIN) |
| 1564 #define MAYBE_TearDownTest DISABLED_TearDownTest | 1564 #define MAYBE_TearDownTest DISABLED_TearDownTest |
| 1565 #else | 1565 #else |
| 1566 #define MAYBE_TearDownTest TearDownTest | 1566 #define MAYBE_TearDownTest TearDownTest |
| (...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1881 INSTANTIATE_TEST_CASE_P(WithoutThreadedCompositor, | 1881 INSTANTIATE_TEST_CASE_P(WithoutThreadedCompositor, |
| 1882 WebViewCaptureTest, | 1882 WebViewCaptureTest, |
| 1883 ::testing::Values(std::string(switches::kDisableThreadedCompositing))); | 1883 ::testing::Values(std::string(switches::kDisableThreadedCompositing))); |
| 1884 | 1884 |
| 1885 // http://crbug.com/171744 | 1885 // http://crbug.com/171744 |
| 1886 #if !defined(OS_MACOSX) | 1886 #if !defined(OS_MACOSX) |
| 1887 INSTANTIATE_TEST_CASE_P(WithThreadedCompositor, | 1887 INSTANTIATE_TEST_CASE_P(WithThreadedCompositor, |
| 1888 WebViewCaptureTest, | 1888 WebViewCaptureTest, |
| 1889 ::testing::Values(std::string(switches::kEnableThreadedCompositing))); | 1889 ::testing::Values(std::string(switches::kEnableThreadedCompositing))); |
| 1890 #endif | 1890 #endif |
| OLD | NEW |