| Index: sky/viewer/internals.cc
|
| diff --git a/sky/viewer/internals.cc b/sky/viewer/internals.cc
|
| index 5edf79affc691598f4274f8550c0ada50d0d28a1..fee5d0babe4e76d04c120822ffdcd32e507e3207 100644
|
| --- a/sky/viewer/internals.cc
|
| +++ b/sky/viewer/internals.cc
|
| @@ -39,7 +39,6 @@ gin::Handle<Internals> Internals::Create(
|
| Internals::Internals(DocumentView* document_view)
|
| : document_view_(document_view->GetWeakPtr()),
|
| shell_binding_(this) {
|
| - mojo::ConnectToService(document_view->imported_services(), &test_harness_);
|
| }
|
|
|
| Internals::~Internals() {
|
| @@ -72,15 +71,18 @@ std::string Internals::ContentAsText() {
|
| }
|
|
|
| void Internals::NotifyTestComplete(const std::string& test_result) {
|
| + if (!document_view_->imported_services())
|
| + return; // Can't call NotifyTestComplete without a test_harness_ impl.
|
| std::vector<unsigned char> pixels;
|
| document_view_->GetPixelsForTesting(&pixels);
|
| + mojo::ConnectToService(document_view_->imported_services(), &test_harness_);
|
| test_harness_->OnTestComplete(test_result,
|
| mojo::Array<uint8_t>::From(pixels));
|
| }
|
|
|
| mojo::Handle Internals::ConnectToEmbedderService(
|
| const std::string& interface_name) {
|
| - if (!document_view_)
|
| + if (!document_view_ || !document_view_->imported_services())
|
| return mojo::Handle();
|
|
|
| mojo::MessagePipe pipe;
|
|
|