Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(336)

Unified Diff: third_party/WebKit/Source/core/html/HTMLFormControlElementTest.cpp

Issue 2878463004: Merge "Forms: Validation Message bubble should not open during print()." to M59. (Closed)
Patch Set: Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLFormControlElement.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/html/HTMLFormControlElementTest.cpp
diff --git a/third_party/WebKit/Source/core/html/HTMLFormControlElementTest.cpp b/third_party/WebKit/Source/core/html/HTMLFormControlElementTest.cpp
index 45ee080c53e54ca6c58fe866c4d86f8cff0571be..81efd28693a3c160178b4b9c6a501144b8d47414 100644
--- a/third_party/WebKit/Source/core/html/HTMLFormControlElementTest.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLFormControlElementTest.cpp
@@ -10,6 +10,7 @@
#include "core/html/HTMLInputElement.h"
#include "core/layout/LayoutObject.h"
#include "core/loader/EmptyClients.h"
+#include "core/page/ScopedPageSuspender.h"
#include "core/page/ValidationMessageClient.h"
#include "core/testing/DummyPageHolder.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -57,7 +58,7 @@ class HTMLFormControlElementTest : public ::testing::Test {
protected:
void SetUp() override;
- DummyPageHolder& Page() const { return *dummy_page_holder_; }
+ Page& GetPage() const { return dummy_page_holder_->GetPage(); }
Document& GetDocument() const { return *document_; }
private:
@@ -128,13 +129,12 @@ TEST_F(HTMLFormControlElementTest, UpdateValidationMessageSkippedIfPrinting) {
GetDocument().View()->UpdateAllLifecyclePhases();
ValidationMessageClient* validation_message_client =
new MockValidationMessageClient();
- GetDocument().GetPage()->SetValidationMessageClient(
- validation_message_client);
+ GetPage().SetValidationMessageClient(validation_message_client);
+ Page::OrdinaryPages().insert(&GetPage());
HTMLInputElement* input =
toHTMLInputElement(GetDocument().getElementById("input"));
- GetDocument().GetFrame()->SetPrinting(true, FloatSize(800, 600),
- FloatSize(800, 600), 1);
+ ScopedPageSuspender suspender; // print() suspends the page.
input->reportValidity();
EXPECT_FALSE(validation_message_client->IsValidationMessageVisible(*input));
}
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLFormControlElement.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698