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

Unified Diff: third_party/WebKit/Source/web/tests/WebFrameTest.cpp

Issue 2928033002: Move GetDocument method from WebFrame to WebLocalFrame. (Closed)
Patch Set: Rebasing... Created 3 years, 6 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
Index: third_party/WebKit/Source/web/tests/WebFrameTest.cpp
diff --git a/third_party/WebKit/Source/web/tests/WebFrameTest.cpp b/third_party/WebKit/Source/web/tests/WebFrameTest.cpp
index 2d31f85568e5356c8f8dc3222ffaa0c97a135619..4ef1f49a261a850a24015fdc515ec4eb925dbf95 100644
--- a/third_party/WebKit/Source/web/tests/WebFrameTest.cpp
+++ b/third_party/WebKit/Source/web/tests/WebFrameTest.cpp
@@ -32,8 +32,10 @@
#include <stdarg.h>
+#include <limits>
#include <map>
#include <memory>
+#include <set>
#include "SkBitmap.h"
#include "SkCanvas.h"
@@ -621,7 +623,7 @@ TEST_P(ParameterizedWebFrameTest, FormWithNullFrame) {
web_view_helper.InitializeAndLoad(base_url_ + "form.html");
WebVector<WebFormElement> forms;
- web_view_helper.WebView()->MainFrame()->GetDocument().Forms(forms);
+ web_view_helper.WebView()->MainFrameImpl()->GetDocument().Forms(forms);
web_view_helper.Reset();
EXPECT_EQ(forms.size(), 1U);
@@ -1016,7 +1018,8 @@ TEST_P(ParameterizedWebFrameTest, DispatchMessageEventWithOriginCheck) {
// Send a message with the correct origin.
WebSecurityOrigin correct_origin(
WebSecurityOrigin::Create(ToKURL(base_url_)));
- WebDocument document = web_view_helper.WebView()->MainFrame()->GetDocument();
+ WebDocument document =
+ web_view_helper.WebView()->MainFrameImpl()->GetDocument();
WebSerializedScriptValue data(WebSerializedScriptValue::CreateInvalid());
WebDOMMessageEvent message(data, "http://origin.com");
web_view_helper.WebView()
@@ -3951,7 +3954,7 @@ TEST_F(WebFrameTest, DivScrollIntoEditableTest) {
web_view_helper.WebView()->AdvanceFocus(false);
// Set the caret to the end of the input box.
web_view_helper.WebView()
- ->MainFrame()
+ ->MainFrameImpl()
->GetDocument()
.GetElementById("EditBoxWithText")
.To<WebInputElement>()
@@ -4048,7 +4051,7 @@ TEST_F(WebFrameTest, DivScrollIntoEditablePreservePageScaleTest) {
web_view_helper.WebView()->AdvanceFocus(false);
// Set the caret to the begining of the input box.
web_view_helper.WebView()
- ->MainFrame()
+ ->MainFrameImpl()
->GetDocument()
.GetElementById("EditBoxWithText")
.To<WebInputElement>()
@@ -5355,7 +5358,7 @@ static WebPoint BottomRightMinusOne(const WebRect& rect) {
return WebPoint(rect.x + rect.width - 1, rect.y + rect.height - 1);
}
-static WebRect ElementBounds(WebFrame* frame, const WebString& id) {
+static WebRect ElementBounds(WebLocalFrame* frame, const WebString& id) {
return frame->GetDocument().GetElementById(id).BoundsInViewport();
}
@@ -6733,9 +6736,8 @@ class StubbornTextCheckClient : public WebTextCheckClient {
StubbornTextCheckClient() : completion_(0) {}
virtual ~StubbornTextCheckClient() {}
- virtual void RequestCheckingOfText(
- const WebString&,
- WebTextCheckingCompletion* completion) override {
+ void RequestCheckingOfText(const WebString&,
+ WebTextCheckingCompletion* completion) override {
completion_ = completion;
}
@@ -7206,7 +7208,7 @@ TEST_P(ParameterizedWebFrameTest, FirstPartyForCookiesForRedirect) {
web_view_helper.InitializeAndLoad(base_url_ + "first_party_redirect.html",
true);
EXPECT_TRUE(web_view_helper.WebView()
- ->MainFrame()
+ ->MainFrameImpl()
->GetDocument()
.FirstPartyForCookies() == redirect_url);
}
@@ -7249,12 +7251,12 @@ TEST_P(ParameterizedWebFrameTest, SimulateFragmentAnchorMiddleClick) {
class TestNewWindowWebViewClient : public FrameTestHelpers::TestWebViewClient {
public:
- virtual WebView* CreateView(WebLocalFrame*,
- const WebURLRequest&,
- const WebWindowFeatures&,
- const WebString&,
- WebNavigationPolicy,
- bool) override {
+ WebView* CreateView(WebLocalFrame*,
+ const WebURLRequest&,
+ const WebWindowFeatures&,
+ const WebString&,
+ WebNavigationPolicy,
+ bool) override {
EXPECT_TRUE(false);
return 0;
}
@@ -7737,8 +7739,8 @@ TEST_P(ParameterizedWebFrameTest, FirstBlankSubframeNavigation) {
frame->ExecuteScript(WebScriptSource(WebString::FromUTF8(
"document.body.appendChild(document.createElement('iframe'))")));
- WebFrame* iframe = frame->FirstChild();
- ASSERT_EQ(&client.ChildClient(), ToWebLocalFrameBase(iframe)->Client());
+ WebLocalFrameBase* iframe = ToWebLocalFrameBase(frame->FirstChild());
+ ASSERT_EQ(&client.ChildClient(), iframe->Client());
std::string url1 = base_url_ + "history.html";
FrameTestHelpers::LoadFrame(iframe, url1);
@@ -7761,7 +7763,7 @@ TEST_P(ParameterizedWebFrameTest, FirstNonBlankSubframeNavigation) {
FrameTestHelpers::WebViewHelper web_view_helper;
web_view_helper.InitializeAndLoad("about:blank", true, &client);
- WebFrame* frame = web_view_helper.WebView()->MainFrame();
+ WebLocalFrame* frame = web_view_helper.WebView()->MainFrameImpl();
std::string url1 = base_url_ + "history.html";
FrameTestHelpers::LoadFrame(
@@ -7772,7 +7774,7 @@ TEST_P(ParameterizedWebFrameTest, FirstNonBlankSubframeNavigation) {
"';"
"document.body.appendChild(f)");
- WebFrame* iframe = frame->FirstChild();
+ WebLocalFrame* iframe = frame->FirstChild()->ToWebLocalFrame();
EXPECT_EQ(url1, iframe->GetDocument().Url().GetString().Utf8());
std::string url2 = base_url_ + "find.html";
@@ -9634,8 +9636,7 @@ TEST_F(WebFrameTest, SwapWithOpenerCycle) {
class CommitTypeWebFrameClient : public FrameTestHelpers::TestWebFrameClient {
public:
- explicit CommitTypeWebFrameClient()
- : history_commit_type_(kWebHistoryInertCommit) {}
+ CommitTypeWebFrameClient() : history_commit_type_(kWebHistoryInertCommit) {}
void DidCommitProvisionalLoad(
const WebHistoryItem&,
@@ -10743,7 +10744,7 @@ TEST_F(WebFrameTest, CopyImageAt) {
->ReadRawImage(WebClipboard::Buffer());
EXPECT_EQ(SkColorSetARGB(255, 255, 0, 0), image.GetSkBitmap().getColor(0, 0));
-};
+}
TEST_F(WebFrameTest, CopyImageAtWithPinchZoom) {
std::string url = base_url_ + "canvas-copy-image.html";
@@ -10770,7 +10771,7 @@ TEST_F(WebFrameTest, CopyImageAtWithPinchZoom) {
->ReadRawImage(WebClipboard::Buffer());
EXPECT_EQ(SkColorSetARGB(255, 255, 0, 0), image.GetSkBitmap().getColor(0, 0));
-};
+}
TEST_F(WebFrameTest, CopyImageWithImageMap) {
SaveImageFromDataURLWebFrameClient client;
@@ -12079,7 +12080,7 @@ TEST_F(WebFrameTest, ShowVirtualKeyboardOnElementFocus) {
class ContextMenuWebFrameClient : public FrameTestHelpers::TestWebFrameClient {
public:
- ContextMenuWebFrameClient(){};
+ ContextMenuWebFrameClient() {}
// WebFrameClient methods
void ShowContextMenu(const WebContextMenuData& data) override {
menu_data_ = data;
@@ -12176,7 +12177,7 @@ TEST_F(WebFrameTest, LocalFrameWithRemoteParentIsTransparent) {
class TestFallbackWebFrameClient : public FrameTestHelpers::TestWebFrameClient {
public:
- explicit TestFallbackWebFrameClient() : child_client_(nullptr) {}
+ TestFallbackWebFrameClient() : child_client_(nullptr) {}
void SetChildWebFrameClient(TestFallbackWebFrameClient* client) {
child_client_ = client;

Powered by Google App Engine
This is Rietveld 408576698