OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "chrome/browser/extensions/extension_test_message_listener.h" |
| 6 #include "chrome/browser/extensions/platform_app_browsertest_util.h" |
| 7 #include "chrome/common/chrome_switches.h" |
| 8 |
| 9 class AdViewTest : public extensions::PlatformAppBrowserTest { |
| 10 protected: |
| 11 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { |
| 12 extensions::PlatformAppBrowserTest::SetUpCommandLine(command_line); |
| 13 command_line->AppendSwitch(switches::kEnableAdview); |
| 14 command_line->AppendSwitch(switches::kEnableAdviewSrcAttribute); |
| 15 } |
| 16 }; |
| 17 |
| 18 IN_PROC_BROWSER_TEST_F(AdViewTest, LoadEventIsCalled) { |
| 19 ASSERT_TRUE(StartTestServer()); |
| 20 |
| 21 ExtensionTestMessageListener listener("guest-loaded", false); |
| 22 LoadAndLaunchPlatformApp("ad_view/load_event"); |
| 23 ASSERT_TRUE(listener.WaitUntilSatisfied()); |
| 24 } |
| 25 |
| 26 IN_PROC_BROWSER_TEST_F(AdViewTest, AdNetworkIsLoaded) { |
| 27 ASSERT_TRUE(StartTestServer()); |
| 28 |
| 29 ExtensionTestMessageListener listener("ad-network-loaded", false); |
| 30 LoadAndLaunchPlatformApp("ad_view/ad_network_loaded"); |
| 31 ASSERT_TRUE(listener.WaitUntilSatisfied()); |
| 32 } |
| 33 |
| 34 // This test currently fails on trybots because it requires new binary file |
| 35 // (image315.png). The test will be enabled once the binary files are committed. |
| 36 IN_PROC_BROWSER_TEST_F(AdViewTest, DISABLED_DisplayFirstAd) { |
| 37 ASSERT_TRUE(StartTestServer()); |
| 38 |
| 39 ExtensionTestMessageListener listener("ad-displayed", false); |
| 40 LoadAndLaunchPlatformApp("ad_view/display_first_ad"); |
| 41 ASSERT_TRUE(listener.WaitUntilSatisfied()); |
| 42 } |
OLD | NEW |