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 "base/path_service.h" | 5 #include "base/path_service.h" |
6 #include "base/process/process.h" | 6 #include "base/process/process.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/app/chrome_command_ids.h" | 9 #include "chrome/app/chrome_command_ids.h" |
10 #include "chrome/browser/apps/app_browsertest_util.h" | 10 #include "chrome/browser/apps/app_browsertest_util.h" |
(...skipping 826 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
837 | 837 |
838 scoped_ptr<content::FakeSpeechRecognitionManager> | 838 scoped_ptr<content::FakeSpeechRecognitionManager> |
839 fake_speech_recognition_manager_; | 839 fake_speech_recognition_manager_; |
840 | 840 |
841 TestGuestViewManagerFactory factory_; | 841 TestGuestViewManagerFactory factory_; |
842 // Note that these are only set if you launch app using LoadAppWithGuest(). | 842 // Note that these are only set if you launch app using LoadAppWithGuest(). |
843 content::WebContents* guest_web_contents_; | 843 content::WebContents* guest_web_contents_; |
844 content::WebContents* embedder_web_contents_; | 844 content::WebContents* embedder_web_contents_; |
845 }; | 845 }; |
846 | 846 |
| 847 // Test suite that containts tests that are meant to run with and without |
| 848 // --site-per-process. |
| 849 class WebViewCommonTest : public extensions::PlatformAppBrowserTest {}; |
| 850 |
847 class WebViewDPITest : public WebViewTest { | 851 class WebViewDPITest : public WebViewTest { |
848 protected: | 852 protected: |
849 void SetUpCommandLine(base::CommandLine* command_line) override { | 853 void SetUpCommandLine(base::CommandLine* command_line) override { |
850 WebViewTest::SetUpCommandLine(command_line); | 854 WebViewTest::SetUpCommandLine(command_line); |
851 command_line->AppendSwitchASCII(switches::kForceDeviceScaleFactor, | 855 command_line->AppendSwitchASCII(switches::kForceDeviceScaleFactor, |
852 base::StringPrintf("%f", scale())); | 856 base::StringPrintf("%f", scale())); |
853 } | 857 } |
854 | 858 |
855 static float scale() { return 2.0f; } | 859 static float scale() { return 2.0f; } |
856 }; | 860 }; |
(...skipping 1847 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2704 // This test verifies that the allowtransparency attribute properly propagates | 2708 // This test verifies that the allowtransparency attribute properly propagates |
2705 IN_PROC_BROWSER_TEST_F(WebViewTest, AllowTransparencyAndAllowScalingPropagate) { | 2709 IN_PROC_BROWSER_TEST_F(WebViewTest, AllowTransparencyAndAllowScalingPropagate) { |
2706 LoadAppWithGuest("web_view/simple"); | 2710 LoadAppWithGuest("web_view/simple"); |
2707 | 2711 |
2708 ASSERT_TRUE(GetGuestWebContents()); | 2712 ASSERT_TRUE(GetGuestWebContents()); |
2709 extensions::WebViewGuest* guest = | 2713 extensions::WebViewGuest* guest = |
2710 extensions::WebViewGuest::FromWebContents(GetGuestWebContents()); | 2714 extensions::WebViewGuest::FromWebContents(GetGuestWebContents()); |
2711 ASSERT_TRUE(guest->allow_transparency()); | 2715 ASSERT_TRUE(guest->allow_transparency()); |
2712 ASSERT_TRUE(guest->allow_scaling()); | 2716 ASSERT_TRUE(guest->allow_scaling()); |
2713 } | 2717 } |
| 2718 |
| 2719 IN_PROC_BROWSER_TEST_F(WebViewCommonTest, BasicPostMessage) { |
| 2720 ASSERT_TRUE(StartEmbeddedTestServer()); // For serving guest pages. |
| 2721 ASSERT_TRUE(RunPlatformAppTest("platform_apps/web_view/post_message/basic")) |
| 2722 << message_; |
| 2723 } |
OLD | NEW |