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 WebViewBasicTest : public extensions::PlatformAppBrowserTest {}; | |
lfg
2015/05/21 22:49:25
[optional] I don't like the BasicTest name, maybe
lazyboy
2015/05/21 23:31:05
Renamed to WebViewCommonTest.
| |
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 1854 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2711 // This test verifies that the allowtransparency attribute properly propagates | 2715 // This test verifies that the allowtransparency attribute properly propagates |
2712 IN_PROC_BROWSER_TEST_F(WebViewTest, AllowTransparencyAndAllowScalingPropagate) { | 2716 IN_PROC_BROWSER_TEST_F(WebViewTest, AllowTransparencyAndAllowScalingPropagate) { |
2713 LoadAppWithGuest("web_view/simple"); | 2717 LoadAppWithGuest("web_view/simple"); |
2714 | 2718 |
2715 ASSERT_TRUE(GetGuestWebContents()); | 2719 ASSERT_TRUE(GetGuestWebContents()); |
2716 extensions::WebViewGuest* guest = | 2720 extensions::WebViewGuest* guest = |
2717 extensions::WebViewGuest::FromWebContents(GetGuestWebContents()); | 2721 extensions::WebViewGuest::FromWebContents(GetGuestWebContents()); |
2718 ASSERT_TRUE(guest->allow_transparency()); | 2722 ASSERT_TRUE(guest->allow_transparency()); |
2719 ASSERT_TRUE(guest->allow_scaling()); | 2723 ASSERT_TRUE(guest->allow_scaling()); |
2720 } | 2724 } |
2725 | |
2726 IN_PROC_BROWSER_TEST_F(WebViewBasicTest, BasicPostMessage) { | |
2727 ASSERT_TRUE(StartEmbeddedTestServer()); // For serving guest pages. | |
2728 ASSERT_TRUE(RunPlatformAppTest("platform_apps/web_view/post_message/basic")) | |
2729 << message_; | |
2730 } | |
OLD | NEW |