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

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

Issue 1215953006: Use sky_shell instead of mojo_shell for testing. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Foo 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
OLDNEW
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 #include "sky/shell/testing/test_runner.h" 5 #include "sky/shell/testing/test_runner.h"
6 6
7 #include <iostream> 7 #include <iostream>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 55
56 } // namespace 56 } // namespace
57 57
58 TestRunner::TestRunner() 58 TestRunner::TestRunner()
59 : shell_view_(new ShellView(Shell::Shared())), 59 : shell_view_(new ShellView(Shell::Shared())),
60 weak_ptr_factory_(this) { 60 weak_ptr_factory_(this) {
61 CHECK(!g_test_runner) << "Only create one TestRunner."; 61 CHECK(!g_test_runner) << "Only create one TestRunner.";
62 62
63 shell_view_->view()->ConnectToEngine(GetProxy(&sky_engine_)); 63 shell_view_->view()->ConnectToEngine(GetProxy(&sky_engine_));
64 ViewportMetricsPtr metrics = ViewportMetrics::New(); 64 ViewportMetricsPtr metrics = ViewportMetrics::New();
65 metrics->physical_width = 320; 65 metrics->physical_width = 800;
66 metrics->physical_height = 640; 66 metrics->physical_height = 600;
67 sky_engine_->OnViewportMetricsChanged(metrics.Pass()); 67 sky_engine_->OnViewportMetricsChanged(metrics.Pass());
68 } 68 }
69 69
70 TestRunner::~TestRunner() { 70 TestRunner::~TestRunner() {
71 } 71 }
72 72
73 TestRunner& TestRunner::Shared() { 73 TestRunner& TestRunner::Shared() {
74 if (!g_test_runner) 74 if (!g_test_runner)
75 g_test_runner = new TestRunner(); 75 g_test_runner = new TestRunner();
76 return *g_test_runner; 76 return *g_test_runner;
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 std::cout << "#BEGIN\n"; 122 std::cout << "#BEGIN\n";
123 std::cout.flush(); 123 std::cout.flush();
124 124
125 if (StartsWithASCII(data.url, kFileUrlPrefix, true)) 125 if (StartsWithASCII(data.url, kFileUrlPrefix, true))
126 ReplaceFirstSubstringAfterOffset(&data.url, 0, kFileUrlPrefix, ""); 126 ReplaceFirstSubstringAfterOffset(&data.url, 0, kFileUrlPrefix, "");
127 sky_engine_->RunFromFile(data.url, package_root_); 127 sky_engine_->RunFromFile(data.url, package_root_);
128 } 128 }
129 129
130 } // namespace shell 130 } // namespace shell
131 } // namespace sky 131 } // namespace sky
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698