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

Unified Diff: blimp/test/browser_tests/blimp_browser_test.h

Issue 1929723002: [Blimp] Adds blimp engine browser test framework and LoadUrl test. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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 | « blimp/test/DEPS ('k') | blimp/test/browser_tests/blimp_browser_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: blimp/test/browser_tests/blimp_browser_test.h
diff --git a/blimp/test/browser_tests/blimp_browser_test.h b/blimp/test/browser_tests/blimp_browser_test.h
new file mode 100644
index 0000000000000000000000000000000000000000..a503a3a3eddd7ce4f1b3868fb5a43aad7320a744
--- /dev/null
+++ b/blimp/test/browser_tests/blimp_browser_test.h
@@ -0,0 +1,68 @@
+// Copyright 2016 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 BLIMP_TEST_BROWSER_TESTS_BLIMP_BROWSER_TEST_H_
+#define BLIMP_TEST_BROWSER_TESTS_BLIMP_BROWSER_TEST_H_
+
+#include <memory>
+
+#include "content/public/test/browser_test_base.h"
+
+namespace base {
+class RunLoop;
+}
+
+namespace content {
+class WebContents;
+}
+
+namespace blimp {
+namespace client {
+struct Assignment;
+} // namespace client
+
+namespace engine {
+class BlimpEngineSession;
+} // namespace engine
+
+// Base class for tests which require a full instance of the Blimp engine.
+class BlimpBrowserTest : public content::BrowserTestBase {
+ public:
+ // Notify that an asynchronous test is now complete and the test runner should
+ // exit.
+ void QuitRunLoop();
+
+ protected:
+ BlimpBrowserTest();
+ ~BlimpBrowserTest() override;
+
+ // Run an asynchronous test in a nested run loop. The caller should call
+ // QuitRunLoop() to notify that the test should finish.
+ void RunUntilQuit();
+
+ engine::BlimpEngineSession* GetEngineSession();
+
+ client::Assignment GetAssignment();
+
+ // testing::Test implementation.
+ void SetUp() override;
+
+ // content::BrowserTestBase implementation.
+ void RunTestOnMainThreadLoop() override;
+ void SetUpOnMainThread() override;
+ void TearDownOnMainThread() override;
+ void SetUpCommandLine(base::CommandLine* command_line) override;
+
+ private:
+ void OnGetEnginePort(uint16_t port);
+
+ uint16_t engine_port_;
+ std::unique_ptr<base::RunLoop> run_loop_;
+
+ DISALLOW_COPY_AND_ASSIGN(BlimpBrowserTest);
+};
+
+} // namespace blimp
+
+#endif // BLIMP_TEST_BROWSER_TESTS_BLIMP_BROWSER_TEST_H_
« no previous file with comments | « blimp/test/DEPS ('k') | blimp/test/browser_tests/blimp_browser_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698