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

Side by Side Diff: sky/shell/testing/test_runner.h

Issue 1229743002: Teach sky_shell.exe to run from a snapshot (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 5 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 unified diff | Download patch
« no previous file with comments | « sky/shell/linux/main.cc ('k') | sky/shell/testing/test_runner.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef SKY_SHELL_TESTING_TEST_RUNNER_H_ 5 #ifndef SKY_SHELL_TESTING_TEST_RUNNER_H_
6 #define SKY_SHELL_TESTING_TEST_RUNNER_H_ 6 #define SKY_SHELL_TESTING_TEST_RUNNER_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
11 #include "base/memory/weak_ptr.h" 11 #include "base/memory/weak_ptr.h"
12 #include "mojo/common/weak_binding_set.h" 12 #include "mojo/common/weak_binding_set.h"
13 #include "mojo/public/cpp/application/interface_factory_impl.h" 13 #include "mojo/public/cpp/application/interface_factory_impl.h"
14 #include "sky/services/engine/sky_engine.mojom.h" 14 #include "sky/services/engine/sky_engine.mojom.h"
15 #include "sky/services/testing/test_harness.mojom.h" 15 #include "sky/services/testing/test_harness.mojom.h"
16 16
17 namespace sky { 17 namespace sky {
18 namespace shell { 18 namespace shell {
19 class ShellView; 19 class ShellView;
20 20
21 class TestRunner : public mojo::InterfaceFactory<TestHarness>, 21 class TestRunner : public mojo::InterfaceFactory<TestHarness>,
22 public TestHarness { 22 public TestHarness {
23 public: 23 public:
24 static TestRunner& Shared(); 24 static TestRunner& Shared();
25 25
26 void set_package_root(const std::string& package_root) { 26 void set_package_root(const std::string& package_root) {
27 package_root_ = package_root; 27 package_root_ = package_root;
28 } 28 }
29 29
30 void Start(const std::string& single_test_url); 30 struct SingleTest {
31 std::string path;
32 bool is_snapshot = false;
33 };
34
35 void Start(scoped_ptr<SingleTest> single_test);
31 36
32 private: 37 private:
33 // mojo::InterfaceFactory<TestHarness> implementation: 38 // mojo::InterfaceFactory<TestHarness> implementation:
34 void Create(mojo::ApplicationConnection* app, 39 void Create(mojo::ApplicationConnection* app,
35 mojo::InterfaceRequest<TestHarness> request) override; 40 mojo::InterfaceRequest<TestHarness> request) override;
36 41
37 // TestHarness implementation: 42 // TestHarness implementation:
38 void OnTestComplete(const mojo::String& test_result, 43 void OnTestComplete(const mojo::String& test_result,
39 const mojo::Array<uint8_t> pixels) override; 44 const mojo::Array<uint8_t> pixels) override;
40 void DispatchInputEvent(mojo::EventPtr event) override; 45 void DispatchInputEvent(mojo::EventPtr event) override;
41 46
42 TestRunner(); 47 TestRunner();
43 ~TestRunner() override; 48 ~TestRunner() override;
44 void ScheduleRun(); 49 void ScheduleRun();
45 void Run(); 50 void Run();
46 51
47 std::string package_root_; 52 std::string package_root_;
48 scoped_ptr<ShellView> shell_view_; 53 scoped_ptr<ShellView> shell_view_;
49 SkyEnginePtr sky_engine_; 54 SkyEnginePtr sky_engine_;
50 55
51 std::string single_test_url_; 56 scoped_ptr<SingleTest> single_test_;
52 mojo::WeakBindingSet<TestHarness> bindings_; 57 mojo::WeakBindingSet<TestHarness> bindings_;
53 58
54 base::WeakPtrFactory<TestRunner> weak_ptr_factory_; 59 base::WeakPtrFactory<TestRunner> weak_ptr_factory_;
55 60
56 DISALLOW_COPY_AND_ASSIGN(TestRunner); 61 DISALLOW_COPY_AND_ASSIGN(TestRunner);
57 }; 62 };
58 63
59 } // namespace shell 64 } // namespace shell
60 } // namespace sky 65 } // namespace sky
61 66
62 #endif // SKY_SHELL_TESTING_TEST_RUNNER_H_ 67 #endif // SKY_SHELL_TESTING_TEST_RUNNER_H_
OLDNEW
« no previous file with comments | « sky/shell/linux/main.cc ('k') | sky/shell/testing/test_runner.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698