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

Side by Side Diff: sky/tools/tester/test_harness.cc

Issue 702603005: Add a sketch of a test_perf script (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "sky/tools/tester/test_harness.h"
6
7 #include "base/bind.h"
8 #include "base/message_loop/message_loop.h"
9 #include <iostream>
10
11 namespace sky {
12 namespace tester {
13 namespace {
14
15 std::string WaitForURL() {
16 std::string url;
17 std::cin >> url;
18 return url;
19 }
20
21 } // namespace
22
23 TestHarness::TestHarness(mojo::View* container)
24 : container_(container),
25 weak_ptr_factory_(this) {
26 std::cout << "#READY\n";
27 std::cout.flush();
28 }
29
30 TestHarness::~TestHarness() {
31 }
32
33 void TestHarness::ScheduleRun() {
34 base::MessageLoop::current()->PostTask(FROM_HERE,
35 base::Bind(&TestHarness::Run, weak_ptr_factory_.GetWeakPtr()));
36 }
37
38 void TestHarness::Run() {
39 DCHECK(!test_runner_);
40 test_runner_.reset(new TestRunner(this, container_, WaitForURL()));
41 }
42
43 void TestHarness::OnTestComplete() {
44 test_runner_.reset();
45 ScheduleRun();
46 }
47
48 } // namespace tester
49 } // namespace sky
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698