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

Unified Diff: sky/shell/testing/test_runner.h

Issue 1218633003: Make it possible to run a test in sky_shell (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: address reviewer comments Created 5 years, 6 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 | « sky/shell/linux/platform_service_provider_linux.cc ('k') | sky/shell/testing/test_runner.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/shell/testing/test_runner.h
diff --git a/sky/shell/testing/test_runner.h b/sky/shell/testing/test_runner.h
new file mode 100644
index 0000000000000000000000000000000000000000..eb27c13d6ebe5ff5da62c8f78c1e9043d0622fd5
--- /dev/null
+++ b/sky/shell/testing/test_runner.h
@@ -0,0 +1,62 @@
+// Copyright 2015 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 SKY_SHELL_TESTING_TEST_RUNNER_H_
+#define SKY_SHELL_TESTING_TEST_RUNNER_H_
+
+#include <string>
+
+#include "base/macros.h"
+#include "base/memory/weak_ptr.h"
+#include "mojo/common/weak_binding_set.h"
+#include "mojo/public/cpp/application/interface_factory_impl.h"
+#include "sky/services/testing/test_harness.mojom.h"
+#include "sky/services/viewport/viewport_observer.mojom.h"
+
+namespace sky {
+namespace shell {
+class ShellView;
+
+class TestRunner : public mojo::InterfaceFactory<TestHarness>,
+ public TestHarness {
+ public:
+ static TestRunner& Shared();
+
+ void set_package_root(const std::string& package_root) {
+ package_root_ = package_root;
+ }
+
+ void Start(const std::string& single_test_url);
+
+ private:
+ // mojo::InterfaceFactory<TestHarness> implementation:
+ void Create(mojo::ApplicationConnection* app,
+ mojo::InterfaceRequest<TestHarness> request) override;
+
+ // TestHarness implementation:
+ void OnTestComplete(const mojo::String& test_result,
+ const mojo::Array<uint8_t> pixels) override;
+ void DispatchInputEvent(mojo::EventPtr event) override;
+
+ TestRunner();
+ ~TestRunner() override;
+ void ScheduleRun();
+ void Run();
+
+ std::string package_root_;
+ scoped_ptr<ShellView> shell_view_;
+ ViewportObserverPtr viewport_observer_;
+
+ std::string single_test_url_;
+ mojo::WeakBindingSet<TestHarness> bindings_;
+
+ base::WeakPtrFactory<TestRunner> weak_ptr_factory_;
+
+ DISALLOW_COPY_AND_ASSIGN(TestRunner);
+};
+
+} // namespace shell
+} // namespace sky
+
+#endif // SKY_SHELL_TESTING_TEST_RUNNER_H_
« no previous file with comments | « sky/shell/linux/platform_service_provider_linux.cc ('k') | sky/shell/testing/test_runner.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698