| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "chrome/browser/apps/app_browsertest_util.h" | |
| 6 #include "chrome/browser/extensions/extension_test_message_listener.h" | |
| 7 #include "chrome/common/chrome_switches.h" | |
| 8 #include "content/test/net/url_request_prepackaged_interceptor.h" | |
| 9 #include "net/url_request/url_fetcher.h" | |
| 10 | |
| 11 class AdViewTest : public extensions::PlatformAppBrowserTest { | |
| 12 protected: | |
| 13 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { | |
| 14 extensions::PlatformAppBrowserTest::SetUpCommandLine(command_line); | |
| 15 command_line->AppendSwitch(switches::kEnableAdview); | |
| 16 } | |
| 17 }; | |
| 18 | |
| 19 // This test checks that <adview> attributes are also exposed as properties | |
| 20 // (with the same name and value). | |
| 21 #if defined(OS_WIN) | |
| 22 // Flaky on Win XP. (http://crbug.com/264362) | |
| 23 #define MAYBE_PropertiesAreInSyncWithAttributes \ | |
| 24 DISABLED_PropertiesAreInSyncWithAttributes | |
| 25 #else | |
| 26 #define MAYBE_PropertiesAreInSyncWithAttributes \ | |
| 27 PropertiesAreInSyncWithAttributes | |
| 28 #endif | |
| 29 IN_PROC_BROWSER_TEST_F(AdViewTest, MAYBE_PropertiesAreInSyncWithAttributes) { | |
| 30 ASSERT_TRUE(StartEmbeddedTestServer()); | |
| 31 | |
| 32 ASSERT_TRUE(RunPlatformAppTest( | |
| 33 "platform_apps/ad_view/properties_exposed")) << message_; | |
| 34 } | |
| 35 | |
| 36 // This test checks an invalid "ad-network" value (i.e. not whitelisted) | |
| 37 // is ignored. | |
| 38 IN_PROC_BROWSER_TEST_F(AdViewTest, InvalidAdNetworkIsIgnored) { | |
| 39 ASSERT_TRUE(StartEmbeddedTestServer()); | |
| 40 | |
| 41 ASSERT_TRUE(RunPlatformAppTest( | |
| 42 "platform_apps/ad_view/invalid_ad_network")) << message_; | |
| 43 } | |
| 44 | |
| 45 class AdViewNotEnabledTest : public extensions::PlatformAppBrowserTest { | |
| 46 protected: | |
| 47 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { | |
| 48 extensions::PlatformAppBrowserTest::SetUpCommandLine(command_line); | |
| 49 //Note: The "kEnableAdview" flag is not here! | |
| 50 } | |
| 51 }; | |
| 52 | |
| 53 // This test checks an <adview> element has no behavior when the "kEnableAdview" | |
| 54 // flag is missing. | |
| 55 IN_PROC_BROWSER_TEST_F(AdViewNotEnabledTest, EnableAdviewFlagRequired) { | |
| 56 ASSERT_TRUE(StartEmbeddedTestServer()); | |
| 57 | |
| 58 ASSERT_TRUE(RunPlatformAppTest( | |
| 59 "platform_apps/ad_view/flag_required")) << message_; | |
| 60 } | |
| OLD | NEW |