提交 6e41ff7e 编写于 作者: D Dan Field 提交者: GitHub

Revert "Provide a stub platform view embedder for tester to avoid emitting errors (#25661)"

This reverts commit 7e69744e.
上级 c0dc2c0b
......@@ -286,7 +286,7 @@ void ImageDecoder::Decode(fml::RefPtr<ImageDescriptor> descriptor_ref_ptr,
flow);
if (!decompressed) {
FML_DLOG(ERROR) << "Could not decompress image.";
FML_LOG(ERROR) << "Could not decompress image.";
result({}, std::move(flow));
return;
}
......@@ -298,7 +298,7 @@ void ImageDecoder::Decode(fml::RefPtr<ImageDescriptor> descriptor_ref_ptr,
flow =
std::move(flow)]() mutable {
if (!io_manager) {
FML_DLOG(ERROR) << "Could not acquire IO manager.";
FML_LOG(ERROR) << "Could not acquire IO manager.";
result({}, std::move(flow));
return;
}
......@@ -316,7 +316,7 @@ void ImageDecoder::Decode(fml::RefPtr<ImageDescriptor> descriptor_ref_ptr,
UploadRasterImage(std::move(decompressed), io_manager, flow);
if (!uploaded.get()) {
FML_DLOG(ERROR) << "Could not upload image to the GPU.";
FML_LOG(ERROR) << "Could not upload image to the GPU.";
result({}, std::move(flow));
return;
}
......
......@@ -171,14 +171,14 @@ void ImageDescriptor::instantiateCodec(Dart_Handle codec_handle,
sk_sp<SkImage> ImageDescriptor::image() const {
SkBitmap bitmap;
if (!bitmap.tryAllocPixels(image_info_)) {
FML_DLOG(ERROR) << "Failed to allocate memory for bitmap of size "
<< image_info_.computeMinByteSize() << "B";
FML_LOG(ERROR) << "Failed to allocate memory for bitmap of size "
<< image_info_.computeMinByteSize() << "B";
return nullptr;
}
const auto& pixmap = bitmap.pixmap();
if (!get_pixels(pixmap)) {
FML_DLOG(ERROR) << "Failed to get pixels for image.";
FML_LOG(ERROR) << "Failed to get pixels for image.";
return nullptr;
}
bitmap.setImmutable();
......
......@@ -25,7 +25,6 @@ executable("testing") {
deps = [
"//flutter/assets",
"//flutter/common",
"//flutter/flow",
"//flutter/fml",
"//flutter/lib/snapshot",
"//flutter/shell/common",
......
......@@ -10,7 +10,6 @@
#include "flutter/assets/asset_manager.h"
#include "flutter/assets/directory_asset_bundle.h"
#include "flutter/flow/embedded_views.h"
#include "flutter/fml/build_config.h"
#include "flutter/fml/file.h"
#include "flutter/fml/make_copyable.h"
......@@ -33,32 +32,6 @@
namespace flutter {
class TesterExternalViewEmbedder : public ExternalViewEmbedder {
// |ExternalViewEmbedder|
SkCanvas* GetRootCanvas() override { return nullptr; }
// |ExternalViewEmbedder|
void CancelFrame() override {}
// |ExternalViewEmbedder|
void BeginFrame(
SkISize frame_size,
GrDirectContext* context,
double device_pixel_ratio,
fml::RefPtr<fml::RasterThreadMerger> raster_thread_merger) override {}
// |ExternalViewEmbedder|
void PrerollCompositeEmbeddedView(
int view_id,
std::unique_ptr<EmbeddedViewParams> params) override {}
// |ExternalViewEmbedder|
std::vector<SkCanvas*> GetCurrentCanvases() override { return {}; }
// |ExternalViewEmbedder|
SkCanvas* CompositeEmbeddedView(int view_id) override { return nullptr; }
};
class TesterPlatformView : public PlatformView,
public GPUSurfaceSoftwareDelegate {
public:
......@@ -100,15 +73,8 @@ class TesterPlatformView : public PlatformView,
return true;
}
// |PlatformView|
std::shared_ptr<ExternalViewEmbedder> CreateExternalViewEmbedder() override {
return external_view_embedder_;
}
private:
sk_sp<SkSurface> sk_surface_ = nullptr;
std::shared_ptr<TesterExternalViewEmbedder> external_view_embedder_ =
std::make_shared<TesterExternalViewEmbedder>();
};
// Checks whether the engine's main Dart isolate has no pending work. If so,
......
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'dart:ui';
import 'package:test/test.dart';
void main() {
test('PlatformView layers do not emit errors from tester', () async {
final SceneBuilder builder = SceneBuilder();
builder.addPlatformView(1);
final Scene scene = builder.build();
window.render(scene);
scene.dispose();
// Test harness asserts that this does not emit an error from the shell logs.
});
}
......@@ -31,31 +31,21 @@ def PrintDivider(char='='):
print(''.join([char for _ in xrange(80)]))
print '\n'
def RunCmd(cmd, forbidden_output=[], **kwargs):
def RunCmd(cmd, **kwargs):
command_string = ' '.join(cmd)
PrintDivider('>')
print 'Running command "%s"' % command_string
start_time = time.time()
stdout_pipe = sys.stdout if not forbidden_output else subprocess.PIPE
stderr_pipe = sys.stderr if not forbidden_output else subprocess.PIPE
process = subprocess.Popen(cmd, stdout=stdout_pipe, stderr=stderr_pipe, **kwargs)
stdout, stderr = process.communicate()
process = subprocess.Popen(cmd, stdout=sys.stdout, stderr=sys.stderr, **kwargs)
process.communicate()
end_time = time.time()
if process.returncode != 0:
PrintDivider('!')
raise Exception('Command "%s" exited with code %d' % (command_string, process.returncode))
if stdout or stderr:
print(stdout)
print(stderr)
for forbidden_string in forbidden_output:
if (stdout and forbidden_string in stdout) or (stderr and forbidden_string in stderr):
raise Exception('command "%s" contained forbidden string %s' % (command_string, forbidden_string))
PrintDivider('<')
print 'Command run successfully in %.2f seconds: %s' % (end_time - start_time, command_string)
......@@ -91,7 +81,7 @@ def FindExecutablePath(path):
raise Exception('Executable %s does not exist!' % path)
def RunEngineExecutable(build_dir, executable_name, filter, flags=[], cwd=buildroot_dir, forbidden_output=[]):
def RunEngineExecutable(build_dir, executable_name, filter, flags=[], cwd=buildroot_dir):
if filter is not None and executable_name not in filter:
print('Skipping %s due to filter.' % executable_name)
return
......@@ -101,7 +91,7 @@ def RunEngineExecutable(build_dir, executable_name, filter, flags=[], cwd=buildr
print('Running %s in %s' % (executable_name, cwd))
test_command = [ executable ] + flags
print(' '.join(test_command))
RunCmd(test_command, cwd=cwd, forbidden_output=forbidden_output)
RunCmd(test_command, cwd=cwd)
def RunCCTests(build_dir, filter):
......@@ -257,8 +247,7 @@ def RunDartTest(build_dir, dart_file, verbose_dart_snapshot, multithreaded, enab
threading = 'single-threaded'
print("Running test '%s' using 'flutter_tester' (%s)" % (kernel_file_name, threading))
forbidden_output = [] if 'unopt' in build_dir else ['[ERROR']
RunEngineExecutable(build_dir, 'flutter_tester', None, command_args, forbidden_output=forbidden_output)
RunEngineExecutable(build_dir, 'flutter_tester', None, command_args)
def RunPubGet(build_dir, directory):
print("Running 'pub get' in the tests directory %s" % dart_tests_dir)
......@@ -274,7 +263,7 @@ def EnsureDebugUnoptSkyPackagesAreBuilt():
variant_out_dir = os.path.join(out_dir, 'host_debug_unopt')
ninja_command = [
'ninja',
'autoninja',
'-C',
variant_out_dir,
'flutter/sky/packages'
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册