Files
engine/shell/testing/test_runner.cc
T
Chinmay Garde 9eb446e0d5 Move shell to //flutter and split shell/BUILD.gn into smaller pieces for each subcomponent. (#3053)
* Namespaces have been updated to reflect the move from //flutter/sky/shell to //flutter/shell.
* shell/BUILD.gn file has been split into smaller GN files for each subcomponent of the shell (common, GPU, diagnostic, testing).
* GN dependencies have been rewritten to stop exposing common shell dependencies as public. Duplicates have also been removed.
* GPU subcomponent has been updated make it more suitable for Vulkan integration.
* The GLFW backend has been resurrected.
2016-09-23 15:33:25 -07:00

43 lines
1.1 KiB
C++

// 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 "flutter/shell/testing/test_runner.h"
#include <iostream>
#include "base/message_loop/message_loop.h"
#include "base/strings/string_util.h"
#include "flutter/shell/common/platform_view.h"
#include "flutter/shell/common/shell.h"
#include "flutter/shell/testing/platform_view_test.h"
namespace shell {
TestRunner::TestRunner()
: platform_view_(new PlatformViewTest()), weak_ptr_factory_(this) {
platform_view_->ConnectToEngine(GetProxy(&sky_engine_));
sky::ViewportMetricsPtr metrics = sky::ViewportMetrics::New();
metrics->physical_width = 800;
metrics->physical_height = 600;
sky_engine_->OnViewportMetricsChanged(metrics.Pass());
}
TestRunner::~TestRunner() = default;
TestRunner& TestRunner::Shared() {
static TestRunner* g_test_runner = nullptr;
if (!g_test_runner)
g_test_runner = new TestRunner();
return *g_test_runner;
}
void TestRunner::Run(const TestDescriptor& test) {
sky_engine_->RunFromFile(test.path, test.packages, "");
}
} // namespace shell