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

Unified Diff: sky/tools/tester/test_runner.cc

Issue 1235053003: Remove //sky/tools/tester (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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sky/tools/tester/test_runner.h ('k') | sky/tools/tester/tester.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/tools/tester/test_runner.cc
diff --git a/sky/tools/tester/test_runner.cc b/sky/tools/tester/test_runner.cc
deleted file mode 100644
index 5982382a543cd6f91378051cc12ace9f18985897..0000000000000000000000000000000000000000
--- a/sky/tools/tester/test_runner.cc
+++ /dev/null
@@ -1,77 +0,0 @@
-// Copyright 2014 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.
-
-#include "sky/tools/tester/test_runner.h"
-
-#include <iostream>
-#include "base/bind.h"
-#include "mojo/public/cpp/application/connect.h"
-#include "mojo/services/view_manager/public/cpp/view.h"
-
-namespace sky {
-namespace tester {
-
-TestRunnerClient::~TestRunnerClient() {
-}
-
-TestRunner::TestRunner(TestRunnerClient* client,
- mojo::View* container,
- const std::string& url,
- bool enable_pixel_dumping)
- : client_(client),
- enable_pixel_dumping_(enable_pixel_dumping),
- weak_ptr_factory_(this) {
- CHECK(client);
-
- mojo::ServiceProviderPtr test_harness_provider;
- test_harness_provider_impl_.AddService(this);
- test_harness_provider_impl_.Bind(GetProxy(&test_harness_provider));
-
- container->Embed(url, nullptr, test_harness_provider.Pass());
-}
-
-TestRunner::~TestRunner() {
-}
-
-base::WeakPtr<TestRunner> TestRunner::GetWeakPtr() {
- return weak_ptr_factory_.GetWeakPtr();
-}
-
-void TestRunner::OnTestStart() {
- std::cout << "#BEGIN\n";
- std::cout.flush();
-}
-
-void TestRunner::OnTestComplete(const std::string& test_result,
- const mojo::Array<uint8_t>& pixels) {
- std::cout << "Content-Type: text/plain\n";
- std::cout << test_result << "\n";
- std::cout << "#EOF\n";
-
- // TODO(ojan): Don't generate the pixels if enable_pixel_dumping_ is false.
- if (enable_pixel_dumping_) {
- // TODO(ojan): Add real hashes here once we want to do pixel tests.
- std::cout << "\nActualHash: FAKEHASHSTUB\n";
- std::cout << "Content-Type: image/png\n";
- std::cout << "Content-Length: " << pixels.size() << "\n";
- CHECK(pixels.size()) << "Could not dump pixels. Did you call notifyTestComplete before the first paint?";
- std::cout.write(
- reinterpret_cast<const char*>(&pixels[0]), pixels.size());
- }
-
- std::cout << "#EOF\n";
- std::cout.flush();
- std::cerr << "#EOF\n";
- std::cerr.flush();
-
- client_->OnTestComplete();
-}
-
-void TestRunner::Create(mojo::ApplicationConnection* app,
- mojo::InterfaceRequest<TestHarness> request) {
- new TestHarnessImpl(this, request.Pass());
-}
-
-} // namespace tester
-} // namespace sky
« no previous file with comments | « sky/tools/tester/test_runner.h ('k') | sky/tools/tester/tester.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698