| 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/stringprintf.h" | 5 #include "base/stringprintf.h" |
| 6 #include "base/utf_string_conversions.h" | 6 #include "base/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" |
| (...skipping 827 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 838 ASSERT_TRUE(done_test_listener.WaitUntilSatisfied()); | 838 ASSERT_TRUE(done_test_listener.WaitUntilSatisfied()); |
| 839 } | 839 } |
| 840 | 840 |
| 841 // Disabled for being flaky: http://crbug.com/237985 | 841 // Disabled for being flaky: http://crbug.com/237985 |
| 842 IN_PROC_BROWSER_TEST_F(WebViewTest, DISABLED_MediaAccessAPIDeny) { | 842 IN_PROC_BROWSER_TEST_F(WebViewTest, DISABLED_MediaAccessAPIDeny) { |
| 843 ASSERT_TRUE(StartTestServer()); // For serving guest pages. | 843 ASSERT_TRUE(StartTestServer()); // For serving guest pages. |
| 844 ASSERT_TRUE(RunPlatformAppTest( | 844 ASSERT_TRUE(RunPlatformAppTest( |
| 845 "platform_apps/web_view/media_access/deny")) << message_; | 845 "platform_apps/web_view/media_access/deny")) << message_; |
| 846 } | 846 } |
| 847 | 847 |
| 848 IN_PROC_BROWSER_TEST_F(WebViewTest, MediaAccessAPIAllow) { | 848 // Disabled for being flaky: http://crbug.com/238662 |
| 849 #if defined(OS_CHROMEOS) |
| 850 #define MAYBE_MediaAccessAPIAllow DISABLED_MediaAccessAPIAllow |
| 851 #else |
| 852 #define MAYBE_MediaAccessAPIAllow MediaAccessAPIAllow |
| 853 #endif |
| 854 IN_PROC_BROWSER_TEST_F(WebViewTest, MAYBE_MediaAccessAPIAllow) { |
| 849 ASSERT_TRUE(StartTestServer()); // For serving guest pages. | 855 ASSERT_TRUE(StartTestServer()); // For serving guest pages. |
| 850 ExtensionTestMessageListener launched_listener("Launched", false); | 856 ExtensionTestMessageListener launched_listener("Launched", false); |
| 851 LoadAndLaunchPlatformApp("web_view/media_access/allow"); | 857 LoadAndLaunchPlatformApp("web_view/media_access/allow"); |
| 852 ASSERT_TRUE(launched_listener.WaitUntilSatisfied()); | 858 ASSERT_TRUE(launched_listener.WaitUntilSatisfied()); |
| 853 | 859 |
| 854 content::WebContents* embedder_web_contents = | 860 content::WebContents* embedder_web_contents = |
| 855 GetFirstShellWindowWebContents(); | 861 GetFirstShellWindowWebContents(); |
| 856 ASSERT_TRUE(embedder_web_contents); | 862 ASSERT_TRUE(embedder_web_contents); |
| 857 MockWebContentsDelegate* mock = new MockWebContentsDelegate; | 863 MockWebContentsDelegate* mock = new MockWebContentsDelegate; |
| 858 embedder_web_contents->SetDelegate(mock); | 864 embedder_web_contents->SetDelegate(mock); |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1001 EXPECT_TRUE(content::ExecuteScript(guest_web_contents, | 1007 EXPECT_TRUE(content::ExecuteScript(guest_web_contents, |
| 1002 "startDownload('download-link-2')")); | 1008 "startDownload('download-link-2')")); |
| 1003 mock_delegate->WaitForCanDownload(true); // Expect to allow. | 1009 mock_delegate->WaitForCanDownload(true); // Expect to allow. |
| 1004 mock_delegate->Reset(); | 1010 mock_delegate->Reset(); |
| 1005 | 1011 |
| 1006 // 3. Guest requests a download that its embedder ignores, this implies deny. | 1012 // 3. Guest requests a download that its embedder ignores, this implies deny. |
| 1007 EXPECT_TRUE(content::ExecuteScript(guest_web_contents, | 1013 EXPECT_TRUE(content::ExecuteScript(guest_web_contents, |
| 1008 "startDownload('download-link-3')")); | 1014 "startDownload('download-link-3')")); |
| 1009 mock_delegate->WaitForCanDownload(false); // Expect to not allow. | 1015 mock_delegate->WaitForCanDownload(false); // Expect to not allow. |
| 1010 } | 1016 } |
| OLD | NEW |