Initialize blink::Platform in pdf_unittests
Calls blink::Platform::InitializeBlink() from pdf_unittests's main(). This allows the use of primitive Blink types like blink::WebString in tests. (Specifically, this depends on initializing WTF.) Bug: 1099022 Change-Id: I9ca8b88645870c0d834225458f6d2e34958d3948 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2390864 Reviewed-by: Daniel Hosseinian <dhoss@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: K. Moon <kmoon@chromium.org> Cr-Commit-Position: refs/heads/master@{#803923}
This commit is contained in:
pdf
@ -310,6 +310,7 @@ if (enable_pdf) {
|
||||
"pdfium/pdfium_test_base.h",
|
||||
"ppapi_migration/geometry_conversions_unittest.cc",
|
||||
"range_set_unittest.cc",
|
||||
"test/run_all_unittests.cc",
|
||||
]
|
||||
|
||||
configs += [
|
||||
@ -328,7 +329,6 @@ if (enable_pdf) {
|
||||
":pdf_test_utils",
|
||||
":ppapi_migration",
|
||||
"//base",
|
||||
"//base/test:run_all_unittests",
|
||||
"//base/test:test_support",
|
||||
"//gin",
|
||||
"//ppapi/c",
|
||||
@ -337,6 +337,7 @@ if (enable_pdf) {
|
||||
"//skia",
|
||||
"//testing/gmock",
|
||||
"//testing/gtest",
|
||||
"//third_party/blink/public:blink",
|
||||
"//third_party/pdfium",
|
||||
"//ui/gfx:test_support",
|
||||
"//ui/gfx/geometry",
|
||||
|
33
pdf/test/run_all_unittests.cc
Normal file
33
pdf/test/run_all_unittests.cc
Normal file
@ -0,0 +1,33 @@
|
||||
// Copyright 2020 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 "base/bind.h"
|
||||
#include "base/callback.h"
|
||||
#include "base/test/launcher/unit_test_launcher.h"
|
||||
#include "base/test/test_suite.h"
|
||||
#include "third_party/blink/public/platform/platform.h"
|
||||
|
||||
namespace {
|
||||
|
||||
class PdfTestSuite final : public base::TestSuite {
|
||||
public:
|
||||
using TestSuite::TestSuite;
|
||||
PdfTestSuite(const PdfTestSuite&) = delete;
|
||||
PdfTestSuite& operator=(const PdfTestSuite&) = delete;
|
||||
|
||||
protected:
|
||||
void Initialize() override {
|
||||
TestSuite::Initialize();
|
||||
blink::Platform::InitializeBlink();
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
PdfTestSuite test_suite(argc, argv);
|
||||
return base::LaunchUnitTests(
|
||||
argc, argv,
|
||||
base::BindOnce(&PdfTestSuite::Run, base::Unretained(&test_suite)));
|
||||
}
|
Reference in New Issue
Block a user