OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_TOOLS_TESTER_TEST_RUNNER_H_ | 5 #ifndef SKY_TOOLS_TESTER_TEST_RUNNER_H_ |
6 #define SKY_TOOLS_TESTER_TEST_RUNNER_H_ | 6 #define SKY_TOOLS_TESTER_TEST_RUNNER_H_ |
7 | 7 |
8 #include "base/memory/weak_ptr.h" | 8 #include "base/memory/weak_ptr.h" |
9 #include "sky/tools/tester/test_harness_impl.h" | 9 #include "sky/tools/tester/test_harness_impl.h" |
10 | 10 |
11 namespace mojo{ | 11 namespace mojo{ |
12 class View; | 12 class View; |
13 } | 13 } |
14 | 14 |
15 namespace sky { | 15 namespace sky { |
16 namespace tester { | 16 namespace tester { |
17 | 17 |
18 class TestRunnerClient { | 18 class TestRunnerClient { |
19 public: | 19 public: |
20 virtual void OnTestComplete() = 0; | 20 virtual void OnTestComplete() = 0; |
21 virtual void DispatchInputEvent(mojo::EventPtr event) = 0; | 21 virtual void DispatchInputEvent(mojo::EventPtr event) = 0; |
22 | 22 |
23 protected: | 23 protected: |
24 virtual ~TestRunnerClient(); | 24 virtual ~TestRunnerClient(); |
25 }; | 25 }; |
26 | 26 |
27 class TestRunner { | 27 class TestRunner { |
28 public: | 28 public: |
29 TestRunner(TestRunnerClient* client, mojo::View* container, | 29 TestRunner(TestRunnerClient* client, mojo::View* container, |
30 const std::string& url); | 30 const std::string& url, bool enable_pixel_dumping); |
31 virtual ~TestRunner(); | 31 virtual ~TestRunner(); |
32 | 32 |
33 TestRunnerClient* client() const { return client_; } | 33 TestRunnerClient* client() const { return client_; } |
34 TestHarnessFactory* test_harness_factory() { return &test_harness_factory_; } | 34 TestHarnessFactory* test_harness_factory() { return &test_harness_factory_; } |
35 | 35 |
36 base::WeakPtr<TestRunner> GetWeakPtr(); | 36 base::WeakPtr<TestRunner> GetWeakPtr(); |
37 void OnTestStart(); | 37 void OnTestStart(); |
38 void OnTestComplete(const std::string& test_result); | 38 void OnTestComplete(const std::string& test_result, |
| 39 const mojo::Array<uint8_t>& pixels); |
39 | 40 |
40 private: | 41 private: |
41 TestHarnessFactory test_harness_factory_; | 42 TestHarnessFactory test_harness_factory_; |
42 TestRunnerClient* client_; | 43 TestRunnerClient* client_; |
43 base::WeakPtrFactory<TestRunner> weak_ptr_factory_; | 44 base::WeakPtrFactory<TestRunner> weak_ptr_factory_; |
| 45 bool enable_pixel_dumping_; |
44 | 46 |
45 MOJO_DISALLOW_COPY_AND_ASSIGN(TestRunner); | 47 MOJO_DISALLOW_COPY_AND_ASSIGN(TestRunner); |
46 }; | 48 }; |
47 | 49 |
48 } // namespace tester | 50 } // namespace tester |
49 } // namespace sky | 51 } // namespace sky |
50 | 52 |
51 #endif // SKY_TOOLS_TESTER_TEST_RUNNER_H_ | 53 #endif // SKY_TOOLS_TESTER_TEST_RUNNER_H_ |
OLD | NEW |