Commit edf17b83 authored by K. Moon's avatar K. Moon Committed by Commit Bot

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/+/2390864Reviewed-by: default avatarDaniel Hosseinian <dhoss@chromium.org>
Reviewed-by: default avatarLei Zhang <thestig@chromium.org>
Commit-Queue: K. Moon <kmoon@chromium.org>
Cr-Commit-Position: refs/heads/master@{#803923}
parent 911cf4f9
...@@ -310,6 +310,7 @@ if (enable_pdf) { ...@@ -310,6 +310,7 @@ if (enable_pdf) {
"pdfium/pdfium_test_base.h", "pdfium/pdfium_test_base.h",
"ppapi_migration/geometry_conversions_unittest.cc", "ppapi_migration/geometry_conversions_unittest.cc",
"range_set_unittest.cc", "range_set_unittest.cc",
"test/run_all_unittests.cc",
] ]
configs += [ configs += [
...@@ -328,7 +329,6 @@ if (enable_pdf) { ...@@ -328,7 +329,6 @@ if (enable_pdf) {
":pdf_test_utils", ":pdf_test_utils",
":ppapi_migration", ":ppapi_migration",
"//base", "//base",
"//base/test:run_all_unittests",
"//base/test:test_support", "//base/test:test_support",
"//gin", "//gin",
"//ppapi/c", "//ppapi/c",
...@@ -337,6 +337,7 @@ if (enable_pdf) { ...@@ -337,6 +337,7 @@ if (enable_pdf) {
"//skia", "//skia",
"//testing/gmock", "//testing/gmock",
"//testing/gtest", "//testing/gtest",
"//third_party/blink/public:blink",
"//third_party/pdfium", "//third_party/pdfium",
"//ui/gfx:test_support", "//ui/gfx:test_support",
"//ui/gfx/geometry", "//ui/gfx/geometry",
......
// 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)));
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment