Commit b7c7185e authored by danakj's avatar danakj Committed by Commit Bot

Move InsertStyleSheet out of TestRunnerForSpecificView

R=avi@chromium.org

Bug: 866140
Change-Id: I4684093db40f628b273c343352a74118830df824
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2202157
Commit-Queue: danakj <danakj@chromium.org>
Reviewed-by: default avatarAvi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#768829}
parent 30be39e9
...@@ -886,8 +886,8 @@ void TestRunnerBindings::AddOriginAccessAllowListEntry( ...@@ -886,8 +886,8 @@ void TestRunnerBindings::AddOriginAccessAllowListEntry(
} }
void TestRunnerBindings::InsertStyleSheet(const std::string& source_code) { void TestRunnerBindings::InsertStyleSheet(const std::string& source_code) {
if (runner_) GetWebFrame()->GetDocument().InsertStyleSheet(
runner_->InsertStyleSheet(source_code); blink::WebString::FromUTF8(source_code));
} }
bool TestRunnerBindings::FindString( bool TestRunnerBindings::FindString(
......
...@@ -316,10 +316,6 @@ class TestRunner { ...@@ -316,10 +316,6 @@ class TestRunner {
const std::string& destination_host, const std::string& destination_host,
bool allow_destination_subdomains); bool allow_destination_subdomains);
// Add |source_code| as an injected stylesheet to the active document of the
// window of the current V8 context.
void InsertStyleSheet(const std::string& source_code);
// Enables or disables subpixel positioning (i.e. fractional X positions for // Enables or disables subpixel positioning (i.e. fractional X positions for
// glyphs) in text rendering on Linux. Since this method changes global // glyphs) in text rendering on Linux. Since this method changes global
// settings, tests that call it must use their own custom font family for // settings, tests that call it must use their own custom font family for
......
...@@ -446,12 +446,6 @@ void TestRunnerForSpecificView::SetIsolatedWorldInfo( ...@@ -446,12 +446,6 @@ void TestRunnerForSpecificView::SetIsolatedWorldInfo(
web_view()->FocusedFrame()->SetIsolatedWorldInfo(world_id, info); web_view()->FocusedFrame()->SetIsolatedWorldInfo(world_id, info);
} }
void TestRunner::InsertStyleSheet(const std::string& source_code) {
blink::WebLocalFrame::FrameForCurrentContext()
->GetDocument()
.InsertStyleSheet(blink::WebString::FromUTF8(source_code));
}
blink::WebLocalFrame* TestRunnerForSpecificView::GetLocalMainFrame() { blink::WebLocalFrame* TestRunnerForSpecificView::GetLocalMainFrame() {
if (!web_view()->MainFrame()->IsWebLocalFrame()) { if (!web_view()->MainFrame()->IsWebLocalFrame()) {
// Hitting the check below uncovers a new scenario that requires OOPIF // Hitting the check below uncovers a new scenario that requires OOPIF
......
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