Commit 34ae34dc authored by Hongchan Choi's avatar Hongchan Choi Committed by Commit Bot

Add ProvideModulesToPage() call to DummyPageHolder

Some Blink unit tests are failing after a new Page<Supplement> is
introduced. This CL adds the support of Supplement to DummyPageHolder
by providing modules to it so they can properly have the supplement
for the test.

A test uses PageTestBase class was also patched individually.

This change is required for crrev.com/1456684.

Bug: 837323
Change-Id: I96b1a49e2a7063ac2aa940376be6e264c23cf395
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1572701Reviewed-by: default avatarDmitry Gozman <dgozman@chromium.org>
Commit-Queue: Hongchan Choi <hongchan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#652190}
parent 979d5b72
......@@ -33,6 +33,7 @@
#include <memory>
#include "base/memory/ptr_util.h"
#include "third_party/blink/renderer/core/core_initializer.h"
#include "third_party/blink/renderer/core/frame/local_dom_window.h"
#include "third_party/blink/renderer/core/frame/local_frame.h"
#include "third_party/blink/renderer/core/frame/local_frame_view.h"
......@@ -80,6 +81,8 @@ DummyPageHolder::DummyPageHolder(
frame_->SetView(LocalFrameView::Create(*frame_, initial_view_size));
frame_->View()->GetPage()->GetVisualViewport().SetSize(initial_view_size);
frame_->Init();
CoreInitializer::GetInstance().ProvideModulesToPage(GetPage(), nullptr);
}
DummyPageHolder::~DummyPageHolder() {
......
......@@ -9,6 +9,7 @@
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/public/platform/web_audio_device.h"
#include "third_party/blink/public/platform/web_audio_latency_hint.h"
#include "third_party/blink/renderer/core/core_initializer.h"
#include "third_party/blink/renderer/core/dom/document.h"
#include "third_party/blink/renderer/core/testing/page_test_base.h"
#include "third_party/blink/renderer/platform/scheduler/public/thread.h"
......@@ -88,7 +89,10 @@ class AudioContextTest : public PageTestBase {
~AudioContextTest() override { platform_.reset(); }
void SetUp() override { PageTestBase::SetUp(IntSize()); }
void SetUp() override {
PageTestBase::SetUp(IntSize());
CoreInitializer::GetInstance().ProvideModulesToPage(GetPage(), nullptr);
}
mojom::blink::AudioContextManagerPtr& GetAudioContextManagerPtrFor(
AudioContext* audio_context) {
......
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