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

Unified Diff: chromecast/shell/browser/test/chromecast_browser_test.h

Issue 518773003: Chromecast: end-to-end browser test based on content::BrowserTest. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@cast-browser-process
Patch Set: rebase Created 6 years, 3 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 | « chromecast/shell/browser/test/OWNERS ('k') | chromecast/shell/browser/test/chromecast_browser_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromecast/shell/browser/test/chromecast_browser_test.h
diff --git a/chromecast/shell/browser/test/chromecast_browser_test.h b/chromecast/shell/browser/test/chromecast_browser_test.h
new file mode 100644
index 0000000000000000000000000000000000000000..da031e790150d06332882c3c51c6977ff786fe5f
--- /dev/null
+++ b/chromecast/shell/browser/test/chromecast_browser_test.h
@@ -0,0 +1,56 @@
+// Copyright 2014 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.
+
+#ifndef CHROMECAST_SHELL_BROWSER_TEST_CHROMECAST_BROWSER_TEST_H_
+#define CHROMECAST_SHELL_BROWSER_TEST_CHROMECAST_BROWSER_TEST_H_
+
+#include "base/macros.h"
+#include "base/memory/scoped_ptr.h"
+#include "content/public/test/browser_test.h"
+#include "content/public/test/browser_test_base.h"
+
+namespace content {
+class WebContents;
+}
+
+namespace chromecast {
+namespace shell {
+
+// This test allows for running an entire browser-process lifecycle per unit
+// test, using Chromecast's cast_shell. This starts up the shell, runs a test
+// case, then shuts down the entire shell.
+// Note that this process takes 7-10 seconds per test case on Chromecast, so
+// fewer test cases with more assertions are preferable.
+class ChromecastBrowserTest : public content::BrowserTestBase {
+ protected:
+ ChromecastBrowserTest();
+ virtual ~ChromecastBrowserTest();
+
+ // testing::Test implementation:
+ virtual void SetUp() OVERRIDE;
+
+ // BrowserTestBase implementation:
+ virtual void RunTestOnMainThreadLoop() OVERRIDE;
+
+ protected:
+ void NavigateToURL(content::WebContents* window, const GURL& gurl);
+
+ // Creates a new window and loads about:blank.
+ content::WebContents* CreateBrowser();
+
+ // Returns the window for the test.
+ content::WebContents* web_contents() const { return web_contents_.get(); }
+
+ private:
+ scoped_ptr<content::WebContents> web_contents_;
+
+ bool setup_called_;
+
+ DISALLOW_COPY_AND_ASSIGN(ChromecastBrowserTest);
+};
+
+} // namespace shell
+} // namespace chromecast
+
+#endif // CHROMECAST_SHELL_BROWSER_TEST_CHROMECAST_BROWSER_TEST_H_
« no previous file with comments | « chromecast/shell/browser/test/OWNERS ('k') | chromecast/shell/browser/test/chromecast_browser_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698