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.
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"
11 class AdViewTest
: public extensions::PlatformAppBrowserTest
{
13 virtual void SetUpCommandLine(CommandLine
* command_line
) OVERRIDE
{
14 extensions::PlatformAppBrowserTest::SetUpCommandLine(command_line
);
15 command_line
->AppendSwitch(switches::kEnableAdview
);
19 // This test checks that <adview> attributes are also exposed as properties
20 // (with the same name and value).
22 // Flaky on Win XP. (http://crbug.com/264362)
23 #define MAYBE_PropertiesAreInSyncWithAttributes \
24 DISABLED_PropertiesAreInSyncWithAttributes
26 #define MAYBE_PropertiesAreInSyncWithAttributes \
27 PropertiesAreInSyncWithAttributes
29 IN_PROC_BROWSER_TEST_F(AdViewTest
, MAYBE_PropertiesAreInSyncWithAttributes
) {
30 ASSERT_TRUE(StartEmbeddedTestServer());
32 ASSERT_TRUE(RunPlatformAppTest(
33 "platform_apps/ad_view/properties_exposed")) << message_
;
36 // This test checks an invalid "ad-network" value (i.e. not whitelisted)
38 IN_PROC_BROWSER_TEST_F(AdViewTest
, InvalidAdNetworkIsIgnored
) {
39 ASSERT_TRUE(StartEmbeddedTestServer());
41 ASSERT_TRUE(RunPlatformAppTest(
42 "platform_apps/ad_view/invalid_ad_network")) << message_
;
45 class AdViewNotEnabledTest
: public extensions::PlatformAppBrowserTest
{
47 virtual void SetUpCommandLine(CommandLine
* command_line
) OVERRIDE
{
48 extensions::PlatformAppBrowserTest::SetUpCommandLine(command_line
);
49 //Note: The "kEnableAdview" flag is not here!
53 // This test checks an <adview> element has no behavior when the "kEnableAdview"
55 IN_PROC_BROWSER_TEST_F(AdViewNotEnabledTest
, EnableAdviewFlagRequired
) {
56 ASSERT_TRUE(StartEmbeddedTestServer());
58 ASSERT_TRUE(RunPlatformAppTest(
59 "platform_apps/ad_view/flag_required")) << message_
;