Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2770)

Unified Diff: chrome/browser/extensions/ad_view_browsertest.cc

Issue 12463015: Enable <adview> tag for packaged apps. (Closed) Base URL: https://git.chromium.org/chromium/src.git@master
Patch Set: Merge fix. Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/chrome_content_browser_client.cc ('k') | chrome/chrome_tests.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/ad_view_browsertest.cc
diff --git a/chrome/browser/extensions/ad_view_browsertest.cc b/chrome/browser/extensions/ad_view_browsertest.cc
new file mode 100644
index 0000000000000000000000000000000000000000..4a70524d7600e530925692b884fdcae56a545410
--- /dev/null
+++ b/chrome/browser/extensions/ad_view_browsertest.cc
@@ -0,0 +1,42 @@
+// Copyright (c) 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/extensions/extension_test_message_listener.h"
+#include "chrome/browser/extensions/platform_app_browsertest_util.h"
+#include "chrome/common/chrome_switches.h"
+
+class AdViewTest : public extensions::PlatformAppBrowserTest {
+ protected:
+ virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE {
+ extensions::PlatformAppBrowserTest::SetUpCommandLine(command_line);
+ command_line->AppendSwitch(switches::kEnableAdview);
+ command_line->AppendSwitch(switches::kEnableAdviewSrcAttribute);
+ }
+};
+
+IN_PROC_BROWSER_TEST_F(AdViewTest, LoadEventIsCalled) {
+ ASSERT_TRUE(StartTestServer());
+
+ ExtensionTestMessageListener listener("guest-loaded", false);
+ LoadAndLaunchPlatformApp("ad_view/load_event");
+ ASSERT_TRUE(listener.WaitUntilSatisfied());
+}
+
+IN_PROC_BROWSER_TEST_F(AdViewTest, AdNetworkIsLoaded) {
+ ASSERT_TRUE(StartTestServer());
+
+ ExtensionTestMessageListener listener("ad-network-loaded", false);
+ LoadAndLaunchPlatformApp("ad_view/ad_network_loaded");
+ ASSERT_TRUE(listener.WaitUntilSatisfied());
+}
+
+// This test currently fails on trybots because it requires new binary file
+// (image315.png). The test will be enabled once the binary files are committed.
+IN_PROC_BROWSER_TEST_F(AdViewTest, DISABLED_DisplayFirstAd) {
+ ASSERT_TRUE(StartTestServer());
+
+ ExtensionTestMessageListener listener("ad-displayed", false);
+ LoadAndLaunchPlatformApp("ad_view/display_first_ad");
+ ASSERT_TRUE(listener.WaitUntilSatisfied());
+}
« no previous file with comments | « chrome/browser/chrome_content_browser_client.cc ('k') | chrome/chrome_tests.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698