summaryrefslogtreecommitdiff
path: root/chromium/third_party/blink/renderer/core/frame/document_loading_rendering_test.cc
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2019-02-13 16:23:34 +0100
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2019-02-14 10:37:21 +0000
commit38a9a29f4f9436cace7f0e7abf9c586057df8a4e (patch)
treec4e8c458dc595bc0ddb435708fa2229edfd00bd4 /chromium/third_party/blink/renderer/core/frame/document_loading_rendering_test.cc
parente684a3455bcc29a6e3e66a004e352dea4e1141e7 (diff)
downloadqtwebengine-chromium-38a9a29f4f9436cace7f0e7abf9c586057df8a4e.tar.gz
BASELINE: Update Chromium to 73.0.3683.37
Change-Id: I08c9af2948b645f671e5d933aca1f7a90ea372f2 Reviewed-by: Michael BrĂ¼ning <michael.bruning@qt.io>
Diffstat (limited to 'chromium/third_party/blink/renderer/core/frame/document_loading_rendering_test.cc')
-rw-r--r--chromium/third_party/blink/renderer/core/frame/document_loading_rendering_test.cc72
1 files changed, 32 insertions, 40 deletions
diff --git a/chromium/third_party/blink/renderer/core/frame/document_loading_rendering_test.cc b/chromium/third_party/blink/renderer/core/frame/document_loading_rendering_test.cc
index 632f5506bb2..2b4e3f2591c 100644
--- a/chromium/third_party/blink/renderer/core/frame/document_loading_rendering_test.cc
+++ b/chromium/third_party/blink/renderer/core/frame/document_loading_rendering_test.cc
@@ -25,8 +25,6 @@ TEST_F(DocumentLoadingRenderingTest,
LoadURL("https://example.com/test.html");
- main_resource.Start();
-
// Still in the head, should not resume commits.
main_resource.Write("<!DOCTYPE html>");
EXPECT_TRUE(Compositor().DeferMainFrameUpdate());
@@ -46,12 +44,11 @@ TEST_F(DocumentLoadingRenderingTest,
TEST_F(DocumentLoadingRenderingTest,
ShouldResumeCommitsAfterBodyIfSheetsLoaded) {
SimRequest main_resource("https://example.com/test.html", "text/html");
- SimRequest css_resource("https://example.com/test.css", "text/css");
+ SimSubresourceRequest css_resource("https://example.com/test.css",
+ "text/css");
LoadURL("https://example.com/test.html");
- main_resource.Start();
-
// Still in the head, should not resume commits.
main_resource.Write("<!DOCTYPE html><link rel=stylesheet href=test.css>");
EXPECT_TRUE(Compositor().DeferMainFrameUpdate());
@@ -76,12 +73,11 @@ TEST_F(DocumentLoadingRenderingTest,
TEST_F(DocumentLoadingRenderingTest, ShouldResumeCommitsAfterSheetsLoaded) {
SimRequest main_resource("https://example.com/test.html", "text/html");
- SimRequest css_resource("https://example.com/test.css", "text/css");
+ SimSubresourceRequest css_resource("https://example.com/test.css",
+ "text/css");
LoadURL("https://example.com/test.html");
- main_resource.Start();
-
// Still in the head, should not resume commits.
main_resource.Write("<!DOCTYPE html><link rel=stylesheet href=test.css>");
EXPECT_TRUE(Compositor().DeferMainFrameUpdate());
@@ -107,12 +103,11 @@ TEST_F(DocumentLoadingRenderingTest, ShouldResumeCommitsAfterSheetsLoaded) {
TEST_F(DocumentLoadingRenderingTest,
ShouldResumeCommitsAfterDocumentElementWithNoSheets) {
SimRequest main_resource("https://example.com/test.svg", "image/svg+xml");
- SimRequest css_resource("https://example.com/test.css", "text/css");
+ SimSubresourceRequest css_resource("https://example.com/test.css",
+ "text/css");
LoadURL("https://example.com/test.svg");
- main_resource.Start();
-
// Sheet loading and no documentElement, so don't resume.
main_resource.Write("<?xml-stylesheet type='text/css' href='test.css'?>");
EXPECT_TRUE(Compositor().DeferMainFrameUpdate());
@@ -132,12 +127,11 @@ TEST_F(DocumentLoadingRenderingTest,
TEST_F(DocumentLoadingRenderingTest, ShouldResumeCommitsAfterSheetsLoadForXml) {
SimRequest main_resource("https://example.com/test.svg", "image/svg+xml");
- SimRequest css_resource("https://example.com/test.css", "text/css");
+ SimSubresourceRequest css_resource("https://example.com/test.css",
+ "text/css");
LoadURL("https://example.com/test.svg");
- main_resource.Start();
-
// Not done parsing.
main_resource.Write("<?xml-stylesheet type='text/css' href='test.css'?>");
EXPECT_TRUE(Compositor().DeferMainFrameUpdate());
@@ -165,8 +159,6 @@ TEST_F(DocumentLoadingRenderingTest, ShouldResumeCommitsAfterFinishParsingXml) {
LoadURL("https://example.com/test.svg");
- main_resource.Start();
-
// Finish parsing, no sheets loading so resume.
main_resource.Finish();
EXPECT_FALSE(Compositor().DeferMainFrameUpdate());
@@ -177,7 +169,6 @@ TEST_F(DocumentLoadingRenderingTest, ShouldResumeImmediatelyForImageDocuments) {
LoadURL("https://example.com/test.png");
- main_resource.Start();
EXPECT_TRUE(Compositor().DeferMainFrameUpdate());
// Not really a valid image but enough for the test. ImageDocuments should
@@ -191,13 +182,13 @@ TEST_F(DocumentLoadingRenderingTest, ShouldResumeImmediatelyForImageDocuments) {
TEST_F(DocumentLoadingRenderingTest, ShouldScheduleFrameAfterSheetsLoaded) {
SimRequest main_resource("https://example.com/test.html", "text/html");
- SimRequest first_css_resource("https://example.com/first.css", "text/css");
- SimRequest second_css_resource("https://example.com/second.css", "text/css");
+ SimSubresourceRequest first_css_resource("https://example.com/first.css",
+ "text/css");
+ SimSubresourceRequest second_css_resource("https://example.com/second.css",
+ "text/css");
LoadURL("https://example.com/test.html");
- main_resource.Start();
-
// Load a stylesheet.
main_resource.Write(
"<!DOCTYPE html><link id=link rel=stylesheet href=first.css>");
@@ -228,11 +219,12 @@ TEST_F(DocumentLoadingRenderingTest,
ShouldNotPaintIframeContentWithPendingSheets) {
SimRequest main_resource("https://example.com/test.html", "text/html");
SimRequest frame_resource("https://example.com/frame.html", "text/html");
- SimRequest css_resource("https://example.com/test.css", "text/css");
+ SimSubresourceRequest css_resource("https://example.com/test.css",
+ "text/css");
LoadURL("https://example.com/test.html");
- WebView().Resize(WebSize(800, 600));
+ WebView().MainFrameWidget()->Resize(WebSize(800, 600));
main_resource.Complete(R"HTML(
<!DOCTYPE html>
@@ -313,11 +305,12 @@ TEST_F(DocumentLoadingRenderingTest,
ShouldThrottleIframeLifecycleUntilPendingSheetsLoaded) {
SimRequest main_resource("https://example.com/main.html", "text/html");
SimRequest frame_resource("https://example.com/frame.html", "text/html");
- SimRequest css_resource("https://example.com/frame.css", "text/css");
+ SimSubresourceRequest css_resource("https://example.com/frame.css",
+ "text/css");
LoadURL("https://example.com/main.html");
- WebView().Resize(WebSize(800, 600));
+ WebView().MainFrameWidget()->Resize(WebSize(800, 600));
main_resource.Complete(R"HTML(
<!DOCTYPE html>
@@ -335,7 +328,7 @@ TEST_F(DocumentLoadingRenderingTest,
ToHTMLIFrameElement(GetDocument().getElementById("frame"));
// Frame while the child frame still has pending sheets.
- auto* frame1_callback = new CheckRafCallback();
+ auto* frame1_callback = MakeGarbageCollected<CheckRafCallback>();
child_frame->contentDocument()->RequestAnimationFrame(frame1_callback);
auto frame1 = Compositor().BeginFrame();
EXPECT_FALSE(frame1_callback->WasCalled());
@@ -347,7 +340,7 @@ TEST_F(DocumentLoadingRenderingTest,
css_resource.Complete();
// Frame with all lifecycle updates enabled.
- auto* frame2_callback = new CheckRafCallback();
+ auto* frame2_callback = MakeGarbageCollected<CheckRafCallback>();
child_frame->contentDocument()->RequestAnimationFrame(frame2_callback);
auto frame2 = Compositor().BeginFrame();
EXPECT_TRUE(frame1_callback->WasCalled());
@@ -359,13 +352,13 @@ TEST_F(DocumentLoadingRenderingTest,
TEST_F(DocumentLoadingRenderingTest,
ShouldContinuePaintingWhenSheetsStartedAfterBody) {
SimRequest main_resource("https://example.com/test.html", "text/html");
- SimRequest css_head_resource("https://example.com/testHead.css", "text/css");
- SimRequest css_body_resource("https://example.com/testBody.css", "text/css");
+ SimSubresourceRequest css_head_resource("https://example.com/testHead.css",
+ "text/css");
+ SimSubresourceRequest css_body_resource("https://example.com/testBody.css",
+ "text/css");
LoadURL("https://example.com/test.html");
- main_resource.Start();
-
// Still in the head, should not paint.
main_resource.Write("<!DOCTYPE html><link rel=stylesheet href=testHead.css>");
EXPECT_FALSE(GetDocument().IsRenderingReady());
@@ -399,13 +392,12 @@ TEST_F(DocumentLoadingRenderingTest,
TEST_F(DocumentLoadingRenderingTest,
returnBoundingClientRectCorrectlyWhileLoadingImport) {
SimRequest main_resource("https://example.com/test.html", "text/html");
- SimRequest import_resource("https://example.com/import.css", "text/css");
+ SimSubresourceRequest import_resource("https://example.com/import.css",
+ "text/css");
LoadURL("https://example.com/test.html");
- WebView().Resize(WebSize(800, 600));
-
- main_resource.Start();
+ WebView().MainFrameWidget()->Resize(WebSize(800, 600));
main_resource.Write(R"HTML(
<html><body>
@@ -436,12 +428,11 @@ TEST_F(DocumentLoadingRenderingTest,
TEST_F(DocumentLoadingRenderingTest, StableSVGStopStylingWhileLoadingImport) {
SimRequest main_resource("https://example.com/test.html", "text/html");
- SimRequest import_resource("https://example.com/import.css", "text/css");
+ SimSubresourceRequest import_resource("https://example.com/import.css",
+ "text/css");
LoadURL("https://example.com/test.html");
- main_resource.Start();
-
main_resource.Write(R"HTML(
<html><body>
<svg>
@@ -461,8 +452,9 @@ TEST_F(DocumentLoadingRenderingTest, StableSVGStopStylingWhileLoadingImport) {
Element* element = GetDocument().getElementById("test");
ASSERT_NE(nullptr, element);
- EXPECT_EQ(0xff008000, element->ComputedStyleRef().SvgStyle().StopColor());
- EXPECT_EQ(.5f, element->ComputedStyleRef().SvgStyle().StopOpacity());
+ const SVGComputedStyle& svg_style = element->ComputedStyleRef().SvgStyle();
+ EXPECT_EQ(0xff008000, svg_style.StopColor().GetColor());
+ EXPECT_EQ(.5f, svg_style.StopOpacity());
};
EXPECT_TRUE(GetDocument().IsRenderingReady());