| 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 b2a8bc64a07faf97a5bc2f33a2479b4c3e1e9307..0e635fdbb02ade4c4eefd8e415047fbcddaabe60 100644
|
| --- a/third_party/WebKit/Source/web/tests/WebFrameTest.cpp
|
| +++ b/third_party/WebKit/Source/web/tests/WebFrameTest.cpp
|
| @@ -450,7 +450,7 @@ TEST_P(ParameterizedWebFrameTest, RequestExecuteScript) {
|
|
|
| v8::HandleScope scope(v8::Isolate::GetCurrent());
|
| ScriptExecutionCallbackHelper callback_helper(
|
| - web_view_helper.WebView()->MainFrameImpl()->MainWorldScriptContext());
|
| + web_view_helper.LocalMainFrame()->MainWorldScriptContext());
|
| web_view_helper.WebView()
|
| ->MainFrameImpl()
|
| ->RequestExecuteScriptAndReturnValue(
|
| @@ -469,7 +469,7 @@ TEST_P(ParameterizedWebFrameTest, SuspendedRequestExecuteScript) {
|
|
|
| v8::HandleScope scope(v8::Isolate::GetCurrent());
|
| ScriptExecutionCallbackHelper callback_helper(
|
| - web_view_helper.WebView()->MainFrameImpl()->MainWorldScriptContext());
|
| + web_view_helper.LocalMainFrame()->MainWorldScriptContext());
|
|
|
| // Suspend scheduled tasks so the script doesn't run.
|
| web_view_helper.WebView()
|
| @@ -504,7 +504,7 @@ TEST_P(ParameterizedWebFrameTest, RequestExecuteV8Function) {
|
|
|
| v8::HandleScope scope(v8::Isolate::GetCurrent());
|
| v8::Local<v8::Context> context =
|
| - web_view_helper.WebView()->MainFrameImpl()->MainWorldScriptContext();
|
| + web_view_helper.LocalMainFrame()->MainWorldScriptContext();
|
| ScriptExecutionCallbackHelper callback_helper(context);
|
| v8::Local<v8::Function> function =
|
| v8::Function::New(context, callback).ToLocalChecked();
|
| @@ -531,10 +531,10 @@ TEST_P(ParameterizedWebFrameTest, RequestExecuteV8FunctionWhileSuspended) {
|
|
|
| v8::HandleScope scope(v8::Isolate::GetCurrent());
|
| v8::Local<v8::Context> context =
|
| - web_view_helper.WebView()->MainFrameImpl()->MainWorldScriptContext();
|
| + web_view_helper.LocalMainFrame()->MainWorldScriptContext();
|
|
|
| // Suspend scheduled tasks so the script doesn't run.
|
| - WebLocalFrameBase* main_frame = web_view_helper.WebView()->MainFrameImpl();
|
| + WebLocalFrameBase* main_frame = web_view_helper.LocalMainFrame();
|
| main_frame->GetFrame()->GetDocument()->SuspendScheduledTasks();
|
|
|
| ScriptExecutionCallbackHelper callback_helper(context);
|
| @@ -565,13 +565,13 @@ TEST_P(ParameterizedWebFrameTest,
|
| };
|
|
|
| // Suspend scheduled tasks so the script doesn't run.
|
| - WebLocalFrameBase* main_frame = web_view_helper.WebView()->MainFrameImpl();
|
| + WebLocalFrameBase* main_frame = web_view_helper.LocalMainFrame();
|
| Document* document = main_frame->GetFrame()->GetDocument();
|
| document->SuspendScheduledTasks();
|
|
|
| v8::HandleScope scope(v8::Isolate::GetCurrent());
|
| v8::Local<v8::Context> context =
|
| - web_view_helper.WebView()->MainFrameImpl()->MainWorldScriptContext();
|
| + web_view_helper.LocalMainFrame()->MainWorldScriptContext();
|
|
|
| std::unique_ptr<UserGestureIndicator> indicator =
|
| WTF::WrapUnique(new UserGestureIndicator(
|
| @@ -601,7 +601,7 @@ TEST_P(ParameterizedWebFrameTest, IframeScriptRemovesSelf) {
|
|
|
| v8::HandleScope scope(v8::Isolate::GetCurrent());
|
| ScriptExecutionCallbackHelper callback_helper(
|
| - web_view_helper.WebView()->MainFrameImpl()->MainWorldScriptContext());
|
| + web_view_helper.LocalMainFrame()->MainWorldScriptContext());
|
| web_view_helper.WebView()
|
| ->MainFrame()
|
| ->FirstChild()
|
| @@ -624,7 +624,7 @@ TEST_P(ParameterizedWebFrameTest, FormWithNullFrame) {
|
| web_view_helper.InitializeAndLoad(base_url_ + "form.html");
|
|
|
| WebVector<WebFormElement> forms;
|
| - web_view_helper.WebView()->MainFrameImpl()->GetDocument().Forms(forms);
|
| + web_view_helper.LocalMainFrame()->GetDocument().Forms(forms);
|
| web_view_helper.Reset();
|
|
|
| EXPECT_EQ(forms.size(), 1U);
|
| @@ -1012,8 +1012,7 @@ 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()->MainFrameImpl()->GetDocument();
|
| + WebDocument document = web_view_helper.LocalMainFrame()->GetDocument();
|
| WebSerializedScriptValue data(WebSerializedScriptValue::CreateInvalid());
|
| WebDOMMessageEvent message(data, "http://origin.com");
|
| web_view_helper.WebView()
|
| @@ -1181,8 +1180,7 @@ TEST_P(ParameterizedWebFrameTest,
|
| LocalFrame* main_frame =
|
| ToLocalFrame(web_view_helper.WebView()->GetPage()->MainFrame());
|
| Document* document = main_frame->GetDocument();
|
| - LocalFrameView* frame_view =
|
| - web_view_helper.WebView()->MainFrameImpl()->GetFrameView();
|
| + LocalFrameView* frame_view = web_view_helper.LocalMainFrame()->GetFrameView();
|
| document->GetSettings()->SetTextAutosizingEnabled(true);
|
| EXPECT_TRUE(document->GetSettings()->TextAutosizingEnabled());
|
| web_view_helper.Resize(WebSize(viewport_width, viewport_height));
|
| @@ -1768,7 +1766,7 @@ TEST_P(ParameterizedWebFrameTest,
|
| web_view_helper.WebView()->GetSettings()->SetForceZeroLayoutHeight(true);
|
| web_view_helper.Resize(WebSize(viewport_width, viewport_height));
|
|
|
| - LocalFrame* frame = web_view_helper.WebView()->MainFrameImpl()->GetFrame();
|
| + LocalFrame* frame = web_view_helper.LocalMainFrame()->GetFrame();
|
| Document* document = frame->GetDocument();
|
| EXPECT_EQ(viewport_height, document->documentElement()->clientHeight());
|
| EXPECT_EQ(viewport_width, document->documentElement()->clientWidth());
|
| @@ -1844,7 +1842,7 @@ TEST_P(ParameterizedWebFrameTest,
|
| EXPECT_EQ(viewport_width, scroll_container->Size().Width());
|
| EXPECT_EQ(viewport_height, scroll_container->Size().Height());
|
|
|
| - LocalFrame* frame = web_view_helper.WebView()->MainFrameImpl()->GetFrame();
|
| + LocalFrame* frame = web_view_helper.LocalMainFrame()->GetFrame();
|
| VisualViewport& visual_viewport = frame->GetPage()->GetVisualViewport();
|
| EXPECT_EQ(viewport_height, visual_viewport.ContainerLayer()->Size().Height());
|
| EXPECT_TRUE(
|
| @@ -1968,7 +1966,7 @@ TEST_F(WebFrameTest,
|
|
|
| IntPoint hit_point = IntPoint(30, 30); // button size is 100x100
|
|
|
| - WebLocalFrameBase* frame = web_view_helper.WebView()->MainFrameImpl();
|
| + WebLocalFrameBase* frame = web_view_helper.LocalMainFrame();
|
| Document* document = frame->GetFrame()->GetDocument();
|
| Element* element = document->getElementById("tap_button");
|
|
|
| @@ -2287,8 +2285,7 @@ TEST_P(ParameterizedWebFrameTest, OverflowHiddenDisablesScrolling) {
|
| base_url_ + "body-overflow-hidden.html");
|
| web_view_helper.Resize(WebSize(viewport_width, viewport_height));
|
|
|
| - LocalFrameView* view =
|
| - web_view_helper.WebView()->MainFrameImpl()->GetFrameView();
|
| + LocalFrameView* view = web_view_helper.LocalMainFrame()->GetFrameView();
|
| EXPECT_FALSE(view->UserInputScrollable(kVerticalScrollbar));
|
| EXPECT_FALSE(view->UserInputScrollable(kHorizontalScrollbar));
|
| }
|
| @@ -2308,12 +2305,11 @@ TEST_P(ParameterizedWebFrameTest,
|
| base_url_ + "body-overflow-hidden-short.html");
|
| web_view_helper.Resize(WebSize(viewport_width, viewport_height));
|
|
|
| - LocalFrameView* view =
|
| - web_view_helper.WebView()->MainFrameImpl()->GetFrameView();
|
| + LocalFrameView* view = web_view_helper.LocalMainFrame()->GetFrameView();
|
| EXPECT_FALSE(view->UserInputScrollable(kVerticalScrollbar));
|
| EXPECT_FALSE(view->UserInputScrollable(kHorizontalScrollbar));
|
|
|
| - web_view_helper.WebView()->MainFrameImpl()->SetCanHaveScrollbars(true);
|
| + web_view_helper.LocalMainFrame()->SetCanHaveScrollbars(true);
|
| EXPECT_FALSE(view->UserInputScrollable(kVerticalScrollbar));
|
| EXPECT_FALSE(view->UserInputScrollable(kHorizontalScrollbar));
|
| }
|
| @@ -2335,8 +2331,7 @@ TEST_F(WebFrameTest, IgnoreOverflowHiddenQuirk) {
|
| base_url_ + "body-overflow-hidden.html");
|
| web_view_helper.Resize(WebSize(viewport_width, viewport_height));
|
|
|
| - LocalFrameView* view =
|
| - web_view_helper.WebView()->MainFrameImpl()->GetFrameView();
|
| + LocalFrameView* view = web_view_helper.LocalMainFrame()->GetFrameView();
|
| EXPECT_TRUE(view->UserInputScrollable(kVerticalScrollbar));
|
| }
|
|
|
| @@ -2394,7 +2389,7 @@ TEST_P(ParameterizedWebFrameTest, setPageScaleFactorDoesNotLayout) {
|
| web_view_helper.Resize(WebSize(viewport_width, viewport_height));
|
|
|
| int prev_layout_count =
|
| - web_view_helper.WebView()->MainFrameImpl()->GetFrameView()->LayoutCount();
|
| + web_view_helper.LocalMainFrame()->GetFrameView()->LayoutCount();
|
| web_view_helper.WebView()->SetPageScaleFactor(3);
|
| EXPECT_FALSE(web_view_helper.WebView()
|
| ->MainFrameImpl()
|
| @@ -2421,7 +2416,7 @@ TEST_P(ParameterizedWebFrameTest,
|
| web_view_helper.Resize(WebSize(viewport_width, viewport_height));
|
|
|
| int prev_layout_count =
|
| - web_view_helper.WebView()->MainFrameImpl()->GetFrameView()->LayoutCount();
|
| + web_view_helper.LocalMainFrame()->GetFrameView()->LayoutCount();
|
| web_view_helper.WebView()->SetPageScaleFactor(30);
|
| EXPECT_FALSE(web_view_helper.WebView()
|
| ->MainFrameImpl()
|
| @@ -2494,8 +2489,7 @@ TEST_P(ParameterizedWebFrameTest, pageScaleFactorDoesntShrinkFrameView) {
|
| &client, nullptr, ConfigureAndroid);
|
| web_view_helper.Resize(WebSize(viewport_width, viewport_height));
|
|
|
| - LocalFrameView* view =
|
| - web_view_helper.WebView()->MainFrameImpl()->GetFrameView();
|
| + LocalFrameView* view = web_view_helper.LocalMainFrame()->GetFrameView();
|
| int viewport_width_minus_scrollbar = viewport_width;
|
| int viewport_height_minus_scrollbar = viewport_height;
|
|
|
| @@ -2962,7 +2956,7 @@ TEST_P(ParameterizedWebFrameTest, AtViewportAffectingAtMediaRecalcCount) {
|
| base_url_ + "viewport-and-media.html");
|
|
|
| Document* document =
|
| - web_view_helper.WebView()->MainFrameImpl()->GetFrame()->GetDocument();
|
| + web_view_helper.LocalMainFrame()->GetFrame()->GetDocument();
|
| EXPECT_EQ(2000, web_view_helper.WebView()
|
| ->MainFrameImpl()
|
| ->GetFrameView()
|
| @@ -2987,8 +2981,7 @@ TEST_P(ParameterizedWebFrameTest, AtViewportWithViewportLengths) {
|
| FrameTestHelpers::LoadFrame(web_view_helper.WebView()->MainFrameImpl(),
|
| base_url_ + "viewport-lengths.html");
|
|
|
| - LocalFrameView* view =
|
| - web_view_helper.WebView()->MainFrameImpl()->GetFrameView();
|
| + LocalFrameView* view = web_view_helper.LocalMainFrame()->GetFrameView();
|
| EXPECT_EQ(400, view->GetLayoutSize().Width());
|
| EXPECT_EQ(300, view->GetLayoutSize().Height());
|
|
|
| @@ -3143,8 +3136,7 @@ TEST_P(ParameterizedWebFrameTest, pageScaleFactorUpdatesScrollbars) {
|
| &client, nullptr, ConfigureAndroid);
|
| web_view_helper.Resize(WebSize(viewport_width, viewport_height));
|
|
|
| - LocalFrameView* view =
|
| - web_view_helper.WebView()->MainFrameImpl()->GetFrameView();
|
| + LocalFrameView* view = web_view_helper.LocalMainFrame()->GetFrameView();
|
| EXPECT_EQ(view->ScrollSize(kHorizontalScrollbar),
|
| view->ContentsSize().Width() - view->VisibleContentRect().Width());
|
| EXPECT_EQ(
|
| @@ -3214,8 +3206,7 @@ TEST_F(WebFrameTest, updateOverlayScrollbarLayers)
|
| FrameTestHelpers::LoadFrame(web_view_helper.WebView()->MainFrameImpl(),
|
| base_url_ + "large-div.html");
|
|
|
| - LocalFrameView* view =
|
| - web_view_helper.WebView()->MainFrameImpl()->GetFrameView();
|
| + LocalFrameView* view = web_view_helper.LocalMainFrame()->GetFrameView();
|
| EXPECT_TRUE(
|
| view->GetLayoutViewItem().Compositor()->LayerForHorizontalScrollbar());
|
| EXPECT_TRUE(
|
| @@ -4160,7 +4151,7 @@ TEST_P(ParameterizedWebFrameTest, FirstRectForCharacterRangeWithPinchZoom) {
|
| web_view_helper.InitializeAndLoad(base_url_ + "textbox.html");
|
| web_view_helper.Resize(WebSize(640, 480));
|
|
|
| - WebLocalFrame* main_frame = web_view_helper.WebView()->MainFrameImpl();
|
| + WebLocalFrame* main_frame = web_view_helper.LocalMainFrame();
|
| main_frame->ExecuteScript(WebScriptSource("selectRange();"));
|
|
|
| WebRect old_rect;
|
| @@ -4281,8 +4272,7 @@ TEST_P(ParameterizedWebFrameTest, ReloadWhileProvisional) {
|
| FrameTestHelpers::ReloadFrameBypassingCache(
|
| web_view_helper.WebView()->MainFrameImpl());
|
|
|
| - WebDataSource* data_source =
|
| - web_view_helper.WebView()->MainFrameImpl()->DataSource();
|
| + WebDataSource* data_source = web_view_helper.LocalMainFrame()->DataSource();
|
| ASSERT_TRUE(data_source);
|
| EXPECT_EQ(ToKURL(base_url_ + "fixed_layout.html"),
|
| KURL(data_source->GetRequest().Url()));
|
| @@ -4295,8 +4285,7 @@ TEST_P(ParameterizedWebFrameTest, AppendRedirects) {
|
| FrameTestHelpers::WebViewHelper web_view_helper;
|
| web_view_helper.InitializeAndLoad(first_url);
|
|
|
| - WebDataSource* data_source =
|
| - web_view_helper.WebView()->MainFrameImpl()->DataSource();
|
| + WebDataSource* data_source = web_view_helper.LocalMainFrame()->DataSource();
|
| ASSERT_TRUE(data_source);
|
| data_source->AppendRedirect(ToKURL(second_url));
|
|
|
| @@ -4318,9 +4307,8 @@ TEST_P(ParameterizedWebFrameTest, IframeRedirect) {
|
| FrameTestHelpers::PumpPendingRequestsForFrameToLoad(
|
| web_view_helper.WebView()->MainFrame());
|
|
|
| - WebFrame* iframe =
|
| - web_view_helper.WebView()->MainFrameImpl()->FindFrameByName(
|
| - WebString::FromUTF8("ifr"));
|
| + WebFrame* iframe = web_view_helper.LocalMainFrame()->FindFrameByName(
|
| + WebString::FromUTF8("ifr"));
|
| ASSERT_TRUE(iframe && iframe->IsWebLocalFrame());
|
| WebDataSource* iframe_data_source = iframe->ToWebLocalFrame()->DataSource();
|
| ASSERT_TRUE(iframe_data_source);
|
| @@ -4488,7 +4476,7 @@ TEST_P(ParameterizedWebFrameTest, ContextNotificationsLoadUnload) {
|
| web_view_helper.InitializeAndLoad(
|
| base_url_ + "context_notifications_test.html", &web_frame_client);
|
|
|
| - WebLocalFrameBase* main_frame = web_view_helper.WebView()->MainFrameImpl();
|
| + WebLocalFrameBase* main_frame = web_view_helper.LocalMainFrame();
|
| WebFrame* child_frame = main_frame->FirstChild();
|
|
|
| ASSERT_EQ(2u, create_notifications.size());
|
| @@ -4552,7 +4540,7 @@ TEST_P(ParameterizedWebFrameTest, ContextNotificationsReload) {
|
|
|
| // The last two create notifications should be for the current frames and
|
| // context.
|
| - WebLocalFrameBase* main_frame = web_view_helper.WebView()->MainFrameImpl();
|
| + WebLocalFrameBase* main_frame = web_view_helper.LocalMainFrame();
|
| WebFrame* child_frame = main_frame->FirstChild();
|
| auto& first_refresh_notification = create_notifications[2];
|
| auto& second_refresh_notification = create_notifications[3];
|
| @@ -4591,7 +4579,7 @@ TEST_P(ParameterizedWebFrameTest, ContextNotificationsIsolatedWorlds) {
|
| int isolated_world_id = 42;
|
| WebScriptSource script_source("hi!");
|
| int num_sources = 1;
|
| - web_view_helper.WebView()->MainFrameImpl()->ExecuteScriptInIsolatedWorld(
|
| + web_view_helper.LocalMainFrame()->ExecuteScriptInIsolatedWorld(
|
| isolated_world_id, &script_source, num_sources);
|
|
|
| // We should now have a new create notification.
|
| @@ -4602,9 +4590,8 @@ TEST_P(ParameterizedWebFrameTest, ContextNotificationsIsolatedWorlds) {
|
|
|
| // We don't have an API to enumarate isolated worlds for a frame, but we can
|
| // at least assert that the context we got is *not* the main world's context.
|
| - ASSERT_NE(
|
| - web_view_helper.WebView()->MainFrameImpl()->MainWorldScriptContext(),
|
| - v8::Local<v8::Context>::New(isolate, notification->context));
|
| + ASSERT_NE(web_view_helper.LocalMainFrame()->MainWorldScriptContext(),
|
| + v8::Local<v8::Context>::New(isolate, notification->context));
|
|
|
| web_view_helper.Reset();
|
|
|
| @@ -4626,8 +4613,8 @@ TEST_P(ParameterizedWebFrameTest, FindInPage) {
|
| RegisterMockedHttpURLLoad("find.html");
|
| FrameTestHelpers::WebViewHelper web_view_helper;
|
| web_view_helper.InitializeAndLoad(base_url_ + "find.html");
|
| - ASSERT_TRUE(web_view_helper.WebView()->MainFrameImpl());
|
| - WebLocalFrame* frame = web_view_helper.WebView()->MainFrameImpl();
|
| + ASSERT_TRUE(web_view_helper.LocalMainFrame());
|
| + WebLocalFrame* frame = web_view_helper.LocalMainFrame();
|
| const int kFindIdentifier = 12345;
|
| WebFindOptions options;
|
|
|
| @@ -4695,7 +4682,7 @@ TEST_P(ParameterizedWebFrameTest, GetContentAsPlainText) {
|
| // We set the size because it impacts line wrapping, which changes the
|
| // resulting text value.
|
| web_view_helper.Resize(WebSize(640, 480));
|
| - WebLocalFrame* frame = web_view_helper.WebView()->MainFrameImpl();
|
| + WebLocalFrame* frame = web_view_helper.LocalMainFrame();
|
|
|
| // Generate a simple test case.
|
| const char kSimpleSource[] = "<div>Foo bar</div><div></div>baz";
|
| @@ -4737,7 +4724,7 @@ TEST_P(ParameterizedWebFrameTest, GetContentAsPlainText) {
|
| TEST_P(ParameterizedWebFrameTest, GetFullHtmlOfPage) {
|
| FrameTestHelpers::WebViewHelper web_view_helper;
|
| web_view_helper.InitializeAndLoad("about:blank");
|
| - WebLocalFrame* frame = web_view_helper.WebView()->MainFrameImpl();
|
| + WebLocalFrame* frame = web_view_helper.LocalMainFrame();
|
|
|
| // Generate a simple test case.
|
| const char kSimpleSource[] = "<p>Hello</p><p>World</p>";
|
| @@ -4837,7 +4824,7 @@ TEST_P(ParameterizedWebFrameTest, FindInPageMatchRects) {
|
|
|
| WebFindOptions options;
|
| WebString search_text = WebString::FromUTF8(kFindString);
|
| - WebLocalFrameBase* main_frame = web_view_helper.WebView()->MainFrameImpl();
|
| + WebLocalFrameBase* main_frame = web_view_helper.LocalMainFrame();
|
| EXPECT_TRUE(main_frame->Find(kFindIdentifier, search_text, options, false));
|
|
|
| main_frame->EnsureTextFinder().ResetMatchCount();
|
| @@ -4903,7 +4890,7 @@ TEST_F(WebFrameTest, FindInPageActiveIndex) {
|
|
|
| WebFindOptions options;
|
| WebString search_text = WebString::FromUTF8(kFindString);
|
| - WebLocalFrameBase* main_frame = web_view_helper.WebView()->MainFrameImpl();
|
| + WebLocalFrameBase* main_frame = web_view_helper.LocalMainFrame();
|
| EXPECT_TRUE(main_frame->Find(kFindIdentifier, search_text, options, false));
|
| main_frame->EnsureTextFinder().ResetMatchCount();
|
|
|
| @@ -4960,7 +4947,7 @@ TEST_P(ParameterizedWebFrameTest, FindOnDetachedFrame) {
|
|
|
| WebFindOptions options;
|
| WebString search_text = WebString::FromUTF8(kFindString);
|
| - WebLocalFrameBase* main_frame = web_view_helper.WebView()->MainFrameImpl();
|
| + WebLocalFrameBase* main_frame = web_view_helper.LocalMainFrame();
|
| WebLocalFrameBase* second_frame =
|
| ToWebLocalFrameBase(main_frame->TraverseNext());
|
|
|
| @@ -5001,7 +4988,7 @@ TEST_P(ParameterizedWebFrameTest, FindDetachFrameBeforeScopeStrings) {
|
|
|
| WebFindOptions options;
|
| WebString search_text = WebString::FromUTF8(kFindString);
|
| - WebLocalFrameBase* main_frame = web_view_helper.WebView()->MainFrameImpl();
|
| + WebLocalFrameBase* main_frame = web_view_helper.LocalMainFrame();
|
|
|
| for (WebFrame* frame = main_frame; frame; frame = frame->TraverseNext())
|
| EXPECT_TRUE(frame->ToWebLocalFrame()->Find(kFindIdentifier, search_text,
|
| @@ -5040,7 +5027,7 @@ TEST_P(ParameterizedWebFrameTest, FindDetachFrameWhileScopingStrings) {
|
|
|
| WebFindOptions options;
|
| WebString search_text = WebString::FromUTF8(kFindString);
|
| - WebLocalFrameBase* main_frame = web_view_helper.WebView()->MainFrameImpl();
|
| + WebLocalFrameBase* main_frame = web_view_helper.LocalMainFrame();
|
|
|
| for (WebFrame* frame = main_frame; frame; frame = frame->TraverseNext())
|
| EXPECT_TRUE(frame->ToWebLocalFrame()->Find(kFindIdentifier, search_text,
|
| @@ -5080,7 +5067,7 @@ TEST_P(ParameterizedWebFrameTest, ResetMatchCount) {
|
|
|
| WebFindOptions options;
|
| WebString search_text = WebString::FromUTF8(kFindString);
|
| - WebLocalFrameBase* main_frame = web_view_helper.WebView()->MainFrameImpl();
|
| + WebLocalFrameBase* main_frame = web_view_helper.LocalMainFrame();
|
|
|
| // Check that child frame exists.
|
| EXPECT_TRUE(!!main_frame->TraverseNext());
|
| @@ -5109,7 +5096,7 @@ TEST_P(ParameterizedWebFrameTest, SetTickmarks) {
|
|
|
| WebFindOptions options;
|
| WebString search_text = WebString::FromUTF8(kFindString);
|
| - WebLocalFrameBase* main_frame = web_view_helper.WebView()->MainFrameImpl();
|
| + WebLocalFrameBase* main_frame = web_view_helper.LocalMainFrame();
|
| EXPECT_TRUE(main_frame->Find(kFindIdentifier, search_text, options, false));
|
|
|
| main_frame->EnsureTextFinder().ResetMatchCount();
|
| @@ -5120,8 +5107,7 @@ TEST_P(ParameterizedWebFrameTest, SetTickmarks) {
|
| EXPECT_TRUE(client.FindResultsAreReady());
|
|
|
| // Get the tickmarks for the original find request.
|
| - LocalFrameView* frame_view =
|
| - web_view_helper.WebView()->MainFrameImpl()->GetFrameView();
|
| + LocalFrameView* frame_view = web_view_helper.LocalMainFrame()->GetFrameView();
|
| Scrollbar* scrollbar = frame_view->CreateScrollbar(kHorizontalScrollbar);
|
| Vector<IntRect> original_tickmarks;
|
| scrollbar->GetTickmarks(original_tickmarks);
|
| @@ -5158,7 +5144,7 @@ TEST_P(ParameterizedWebFrameTest, FindInPageJavaScriptUpdatesDOM) {
|
| web_view_helper.Resize(WebSize(640, 480));
|
| RunPendingTasks();
|
|
|
| - WebLocalFrameBase* frame = web_view_helper.WebView()->MainFrameImpl();
|
| + WebLocalFrameBase* frame = web_view_helper.LocalMainFrame();
|
| const int kFindIdentifier = 12345;
|
| static const char* kFindString = "foo";
|
| WebString search_text = WebString::FromUTF8(kFindString);
|
| @@ -5231,7 +5217,7 @@ TEST_P(ParameterizedWebFrameTest, FindInPageJavaScriptUpdatesDOMProperOrdinal) {
|
| FrameTestHelpers::WebViewHelper web_view_helper;
|
| web_view_helper.Initialize(&client);
|
|
|
| - WebLocalFrameBase* frame = web_view_helper.WebView()->MainFrameImpl();
|
| + WebLocalFrameBase* frame = web_view_helper.LocalMainFrame();
|
| FrameTestHelpers::LoadHTMLString(frame, html,
|
| URLTestHelpers::ToKURL(base_url_));
|
| web_view_helper.Resize(WebSize(640, 480));
|
| @@ -5287,8 +5273,8 @@ TEST_P(ParameterizedWebFrameTest,
|
| RegisterMockedHttpURLLoad("hello_world.html");
|
| FrameTestHelpers::WebViewHelper web_view_helper;
|
| web_view_helper.InitializeAndLoad(base_url_ + "find.html");
|
| - ASSERT_TRUE(web_view_helper.WebView()->MainFrameImpl());
|
| - WebLocalFrame* frame = web_view_helper.WebView()->MainFrameImpl();
|
| + ASSERT_TRUE(web_view_helper.LocalMainFrame());
|
| + WebLocalFrame* frame = web_view_helper.LocalMainFrame();
|
| const int kFindIdentifier = 12345;
|
| WebFindOptions options;
|
|
|
| @@ -5336,7 +5322,7 @@ TEST_P(ParameterizedWebFrameTest, SelectRange) {
|
| FrameTestHelpers::WebViewHelper web_view_helper;
|
| InitializeTextSelectionWebView(base_url_ + "select_range_basic.html",
|
| &web_view_helper);
|
| - frame = web_view_helper.WebView()->MainFrameImpl();
|
| + frame = web_view_helper.LocalMainFrame();
|
| EXPECT_EQ("Some test text for testing.", SelectionAsString(frame));
|
| web_view_helper.WebView()->SelectionBounds(start_web_rect, end_web_rect);
|
| frame->ExecuteCommand(WebString::FromUTF8("Unselect"));
|
| @@ -5351,7 +5337,7 @@ TEST_P(ParameterizedWebFrameTest, SelectRange) {
|
|
|
| InitializeTextSelectionWebView(base_url_ + "select_range_scroll.html",
|
| &web_view_helper);
|
| - frame = web_view_helper.WebView()->MainFrameImpl();
|
| + frame = web_view_helper.LocalMainFrame();
|
| EXPECT_EQ("Some offscreen test text for testing.", SelectionAsString(frame));
|
| web_view_helper.WebView()->SelectionBounds(start_web_rect, end_web_rect);
|
| frame->ExecuteCommand(WebString::FromUTF8("Unselect"));
|
| @@ -5372,7 +5358,7 @@ TEST_P(ParameterizedWebFrameTest, SelectRangeDefaultHandleVisibility) {
|
| InitializeTextSelectionWebView(base_url_ + "select_range_basic.html",
|
| &web_view_helper);
|
|
|
| - WebLocalFrameBase* frame = web_view_helper.WebView()->MainFrameImpl();
|
| + WebLocalFrameBase* frame = web_view_helper.LocalMainFrame();
|
| frame->SelectRange(WebRange(0, 5));
|
| EXPECT_FALSE(frame->SelectionRange().IsNull());
|
|
|
| @@ -5387,7 +5373,7 @@ TEST_P(ParameterizedWebFrameTest, SelectRangeHideHandle) {
|
| InitializeTextSelectionWebView(base_url_ + "select_range_basic.html",
|
| &web_view_helper);
|
|
|
| - WebLocalFrameBase* frame = web_view_helper.WebView()->MainFrameImpl();
|
| + WebLocalFrameBase* frame = web_view_helper.LocalMainFrame();
|
| frame->SelectRange(WebRange(0, 5), WebLocalFrame::kHideSelectionHandle);
|
|
|
| EXPECT_FALSE(frame->GetFrame()->Selection().IsHandleVisible())
|
| @@ -5401,7 +5387,7 @@ TEST_P(ParameterizedWebFrameTest, SelectRangeShowHandle) {
|
| InitializeTextSelectionWebView(base_url_ + "select_range_basic.html",
|
| &web_view_helper);
|
|
|
| - WebLocalFrameBase* frame = web_view_helper.WebView()->MainFrameImpl();
|
| + WebLocalFrameBase* frame = web_view_helper.LocalMainFrame();
|
| frame->SelectRange(WebRange(0, 5), WebLocalFrame::kShowSelectionHandle);
|
|
|
| EXPECT_TRUE(frame->GetFrame()->Selection().IsHandleVisible())
|
| @@ -5415,7 +5401,7 @@ TEST_P(ParameterizedWebFrameTest, SelectRangePreserveHandleVisibility) {
|
| InitializeTextSelectionWebView(base_url_ + "select_range_basic.html",
|
| &web_view_helper);
|
|
|
| - WebLocalFrameBase* frame = web_view_helper.WebView()->MainFrameImpl();
|
| + WebLocalFrameBase* frame = web_view_helper.LocalMainFrame();
|
| frame->SelectRange(WebRange(0, 5), WebLocalFrame::kHideSelectionHandle);
|
| frame->SelectRange(WebRange(0, 6), WebLocalFrame::kPreserveHandleVisibility);
|
|
|
| @@ -5468,7 +5454,7 @@ TEST_P(ParameterizedWebFrameTest, SelectRangeDivContentEditable) {
|
| FrameTestHelpers::WebViewHelper web_view_helper;
|
| InitializeTextSelectionWebView(base_url_ + "select_range_div_editable.html",
|
| &web_view_helper);
|
| - frame = web_view_helper.WebView()->MainFrameImpl();
|
| + frame = web_view_helper.LocalMainFrame();
|
| EXPECT_EQ("This text is initially selected.", SelectionAsString(frame));
|
| web_view_helper.WebView()->SelectionBounds(start_web_rect, end_web_rect);
|
|
|
| @@ -5479,7 +5465,7 @@ TEST_P(ParameterizedWebFrameTest, SelectRangeDivContentEditable) {
|
| // As above, but extending the selection to the bottom of the document.
|
| InitializeTextSelectionWebView(base_url_ + "select_range_div_editable.html",
|
| &web_view_helper);
|
| - frame = web_view_helper.WebView()->MainFrameImpl();
|
| + frame = web_view_helper.LocalMainFrame();
|
|
|
| web_view_helper.WebView()->SelectionBounds(start_web_rect, end_web_rect);
|
| frame->SelectRange(TopLeft(start_web_rect),
|
| @@ -5509,7 +5495,7 @@ TEST_P(ParameterizedWebFrameTest, DISABLED_SelectRangeSpanContentEditable) {
|
| FrameTestHelpers::WebViewHelper web_view_helper;
|
| InitializeTextSelectionWebView(base_url_ + "select_range_span_editable.html",
|
| &web_view_helper);
|
| - frame = web_view_helper.WebView()->MainFrameImpl();
|
| + frame = web_view_helper.LocalMainFrame();
|
| EXPECT_EQ("This text is initially selected.", SelectionAsString(frame));
|
| web_view_helper.WebView()->SelectionBounds(start_web_rect, end_web_rect);
|
|
|
| @@ -5520,7 +5506,7 @@ TEST_P(ParameterizedWebFrameTest, DISABLED_SelectRangeSpanContentEditable) {
|
| // As above, but extending the selection to the bottom of the document.
|
| InitializeTextSelectionWebView(base_url_ + "select_range_span_editable.html",
|
| &web_view_helper);
|
| - frame = web_view_helper.WebView()->MainFrameImpl();
|
| + frame = web_view_helper.LocalMainFrame();
|
|
|
| web_view_helper.WebView()->SelectionBounds(start_web_rect, end_web_rect);
|
| frame->SelectRange(TopLeft(start_web_rect),
|
| @@ -5540,7 +5526,7 @@ TEST_P(ParameterizedWebFrameTest, SelectRangeCanMoveSelectionStart) {
|
| FrameTestHelpers::WebViewHelper web_view_helper;
|
| InitializeTextSelectionWebView(base_url_ + "text_selection.html",
|
| &web_view_helper);
|
| - WebLocalFrame* frame = web_view_helper.WebView()->MainFrameImpl();
|
| + WebLocalFrame* frame = web_view_helper.LocalMainFrame();
|
|
|
| // Select second span. We can move the start to include the first span.
|
| frame->ExecuteScript(WebScriptSource("selectElement('header_2');"));
|
| @@ -5596,7 +5582,7 @@ TEST_P(ParameterizedWebFrameTest, SelectRangeCanMoveSelectionEnd) {
|
| FrameTestHelpers::WebViewHelper web_view_helper;
|
| InitializeTextSelectionWebView(base_url_ + "text_selection.html",
|
| &web_view_helper);
|
| - WebLocalFrame* frame = web_view_helper.WebView()->MainFrameImpl();
|
| + WebLocalFrame* frame = web_view_helper.LocalMainFrame();
|
|
|
| // Select first span. We can move the end to include the second span.
|
| frame->ExecuteScript(WebScriptSource("selectElement('header_1');"));
|
| @@ -5657,7 +5643,7 @@ TEST_P(ParameterizedWebFrameTest, MoveRangeSelectionExtent) {
|
| FrameTestHelpers::WebViewHelper web_view_helper;
|
| InitializeTextSelectionWebView(base_url_ + "move_range_selection_extent.html",
|
| &web_view_helper);
|
| - frame = web_view_helper.WebView()->MainFrameImpl();
|
| + frame = web_view_helper.LocalMainFrame();
|
| EXPECT_EQ("This text is initially selected.", SelectionAsString(frame));
|
| web_view_helper.WebView()->SelectionBounds(start_web_rect, end_web_rect);
|
|
|
| @@ -5694,7 +5680,7 @@ TEST_P(ParameterizedWebFrameTest, MoveRangeSelectionExtentCannotCollapse) {
|
| FrameTestHelpers::WebViewHelper web_view_helper;
|
| InitializeTextSelectionWebView(base_url_ + "move_range_selection_extent.html",
|
| &web_view_helper);
|
| - frame = web_view_helper.WebView()->MainFrameImpl();
|
| + frame = web_view_helper.LocalMainFrame();
|
| EXPECT_EQ("This text is initially selected.", SelectionAsString(frame));
|
| web_view_helper.WebView()->SelectionBounds(start_web_rect, end_web_rect);
|
|
|
| @@ -5721,7 +5707,7 @@ TEST_P(ParameterizedWebFrameTest, MoveRangeSelectionExtentScollsInputField) {
|
| InitializeTextSelectionWebView(
|
| base_url_ + "move_range_selection_extent_input_field.html",
|
| &web_view_helper);
|
| - frame = web_view_helper.WebView()->MainFrameImpl();
|
| + frame = web_view_helper.LocalMainFrame();
|
| EXPECT_EQ("Length", SelectionAsString(frame));
|
| web_view_helper.WebView()->SelectionBounds(start_web_rect, end_web_rect);
|
|
|
| @@ -5755,7 +5741,7 @@ TEST_P(ParameterizedWebFrameTest, DISABLED_PositionForPointTest) {
|
| FrameTestHelpers::WebViewHelper web_view_helper;
|
| InitializeTextSelectionWebView(base_url_ + "select_range_span_editable.html",
|
| &web_view_helper);
|
| - WebLocalFrameBase* main_frame = web_view_helper.WebView()->MainFrameImpl();
|
| + WebLocalFrameBase* main_frame = web_view_helper.LocalMainFrame();
|
| LayoutObject* layout_object =
|
| main_frame->GetFrame()
|
| ->Selection()
|
| @@ -5768,7 +5754,7 @@ TEST_P(ParameterizedWebFrameTest, DISABLED_PositionForPointTest) {
|
| RegisterMockedHttpURLLoad("select_range_div_editable.html");
|
| InitializeTextSelectionWebView(base_url_ + "select_range_div_editable.html",
|
| &web_view_helper);
|
| - main_frame = web_view_helper.WebView()->MainFrameImpl();
|
| + main_frame = web_view_helper.LocalMainFrame();
|
| layout_object = main_frame->GetFrame()
|
| ->Selection()
|
| .ComputeVisibleSelectionInDOMTreeDeprecated()
|
| @@ -5786,7 +5772,7 @@ TEST_P(ParameterizedWebFrameTest,
|
| FrameTestHelpers::WebViewHelper web_view_helper;
|
| InitializeTextSelectionWebView(base_url_ + "move_caret.html",
|
| &web_view_helper);
|
| - WebLocalFrameBase* frame = web_view_helper.WebView()->MainFrameImpl();
|
| + WebLocalFrameBase* frame = web_view_helper.LocalMainFrame();
|
|
|
| WebRect initial_start_rect;
|
| WebRect initial_end_rect;
|
| @@ -6557,7 +6543,7 @@ TEST_P(ParameterizedWebFrameTest, ReplaceMisspelledRange) {
|
| FrameTestHelpers::WebViewHelper web_view_helper;
|
| InitializeTextSelectionWebView(base_url_ + "spell.html", &web_view_helper);
|
|
|
| - WebLocalFrameBase* frame = web_view_helper.WebView()->MainFrameImpl();
|
| + WebLocalFrameBase* frame = web_view_helper.LocalMainFrame();
|
| TextCheckClient textcheck;
|
| frame->SetTextCheckClient(&textcheck);
|
|
|
| @@ -6604,7 +6590,7 @@ TEST_P(ParameterizedWebFrameTest, RemoveSpellingMarkers) {
|
| FrameTestHelpers::WebViewHelper web_view_helper;
|
| InitializeTextSelectionWebView(base_url_ + "spell.html", &web_view_helper);
|
|
|
| - WebLocalFrameBase* frame = web_view_helper.WebView()->MainFrameImpl();
|
| + WebLocalFrameBase* frame = web_view_helper.LocalMainFrame();
|
| TextCheckClient textcheck;
|
| frame->SetTextCheckClient(&textcheck);
|
|
|
| @@ -6655,7 +6641,7 @@ TEST_P(ParameterizedWebFrameTest, RemoveSpellingMarkersUnderWords) {
|
| FrameTestHelpers::WebViewHelper web_view_helper;
|
| InitializeTextSelectionWebView(base_url_ + "spell.html", &web_view_helper);
|
|
|
| - WebLocalFrameBase* web_frame = web_view_helper.WebView()->MainFrameImpl();
|
| + WebLocalFrameBase* web_frame = web_view_helper.LocalMainFrame();
|
| TextCheckClient textcheck;
|
| web_frame->SetTextCheckClient(&textcheck);
|
|
|
| @@ -6734,7 +6720,7 @@ TEST_P(ParameterizedWebFrameTest, SlowSpellcheckMarkerPosition) {
|
| FrameTestHelpers::WebViewHelper web_view_helper;
|
| InitializeTextSelectionWebView(base_url_ + "spell.html", &web_view_helper);
|
|
|
| - WebLocalFrameBase* frame = web_view_helper.WebView()->MainFrameImpl();
|
| + WebLocalFrameBase* frame = web_view_helper.LocalMainFrame();
|
| StubbornTextCheckClient textcheck;
|
| frame->SetTextCheckClient(&textcheck);
|
|
|
| @@ -6776,7 +6762,7 @@ TEST_P(ParameterizedWebFrameTest, CancelSpellingRequestCrash) {
|
| FrameTestHelpers::WebViewHelper web_view_helper;
|
| web_view_helper.InitializeAndLoad(base_url_ + "spell.html");
|
|
|
| - WebLocalFrameBase* frame = web_view_helper.WebView()->MainFrameImpl();
|
| + WebLocalFrameBase* frame = web_view_helper.LocalMainFrame();
|
| frame->SetTextCheckClient(0);
|
|
|
| Document* document = frame->GetFrame()->GetDocument();
|
| @@ -6796,7 +6782,7 @@ TEST_P(ParameterizedWebFrameTest, SpellcheckResultErasesMarkers) {
|
| FrameTestHelpers::WebViewHelper web_view_helper;
|
| InitializeTextSelectionWebView(base_url_ + "spell.html", &web_view_helper);
|
|
|
| - WebLocalFrameBase* frame = web_view_helper.WebView()->MainFrameImpl();
|
| + WebLocalFrameBase* frame = web_view_helper.LocalMainFrame();
|
| StubbornTextCheckClient textcheck;
|
| frame->SetTextCheckClient(&textcheck);
|
|
|
| @@ -6834,7 +6820,7 @@ TEST_P(ParameterizedWebFrameTest, SpellcheckResultsSavedInDocument) {
|
| FrameTestHelpers::WebViewHelper web_view_helper;
|
| InitializeTextSelectionWebView(base_url_ + "spell.html", &web_view_helper);
|
|
|
| - WebLocalFrameBase* frame = web_view_helper.WebView()->MainFrameImpl();
|
| + WebLocalFrameBase* frame = web_view_helper.LocalMainFrame();
|
| StubbornTextCheckClient textcheck;
|
| frame->SetTextCheckClient(&textcheck);
|
|
|
| @@ -7081,7 +7067,7 @@ TEST_F(WebFrameTest, CompositorScrollIsUserScrollLongPage) {
|
| web_view_helper.InitializeAndLoad(base_url_ + "long_scroll.html", &client);
|
| web_view_helper.Resize(WebSize(1000, 1000));
|
|
|
| - WebLocalFrameBase* frame_impl = web_view_helper.WebView()->MainFrameImpl();
|
| + WebLocalFrameBase* frame_impl = web_view_helper.LocalMainFrame();
|
| DocumentLoader::InitialScrollState& initial_scroll_state =
|
| frame_impl->GetFrame()
|
| ->Loader()
|
| @@ -7275,9 +7261,9 @@ TEST_P(ParameterizedWebFrameTest, BackToReload) {
|
| RegisterMockedHttpURLLoad("fragment_middle_click.html");
|
| FrameTestHelpers::WebViewHelper web_view_helper;
|
| web_view_helper.InitializeAndLoad(base_url_ + "fragment_middle_click.html");
|
| - WebLocalFrame* frame = web_view_helper.WebView()->MainFrameImpl();
|
| + WebLocalFrame* frame = web_view_helper.LocalMainFrame();
|
| const FrameLoader& main_frame_loader =
|
| - web_view_helper.WebView()->MainFrameImpl()->GetFrame()->Loader();
|
| + web_view_helper.LocalMainFrame()->GetFrame()->Loader();
|
| Persistent<HistoryItem> first_item =
|
| main_frame_loader.GetDocumentLoader()->GetHistoryItem();
|
| EXPECT_TRUE(first_item);
|
| @@ -7332,7 +7318,7 @@ TEST_P(ParameterizedWebFrameTest, ReloadPost) {
|
| RegisterMockedHttpURLLoad("reload_post.html");
|
| FrameTestHelpers::WebViewHelper web_view_helper;
|
| web_view_helper.InitializeAndLoad(base_url_ + "reload_post.html");
|
| - WebLocalFrame* frame = web_view_helper.WebView()->MainFrameImpl();
|
| + WebLocalFrame* frame = web_view_helper.LocalMainFrame();
|
|
|
| FrameTestHelpers::LoadFrame(web_view_helper.WebView()->MainFrameImpl(),
|
| "javascript:document.forms[0].submit()");
|
| @@ -7354,9 +7340,9 @@ TEST_P(ParameterizedWebFrameTest, LoadHistoryItemReload) {
|
| RegisterMockedHttpURLLoad("fragment_middle_click.html");
|
| FrameTestHelpers::WebViewHelper web_view_helper;
|
| web_view_helper.InitializeAndLoad(base_url_ + "fragment_middle_click.html");
|
| - WebLocalFrame* frame = web_view_helper.WebView()->MainFrameImpl();
|
| + WebLocalFrame* frame = web_view_helper.LocalMainFrame();
|
| const FrameLoader& main_frame_loader =
|
| - web_view_helper.WebView()->MainFrameImpl()->GetFrame()->Loader();
|
| + web_view_helper.LocalMainFrame()->GetFrame()->Loader();
|
| Persistent<HistoryItem> first_item =
|
| main_frame_loader.GetDocumentLoader()->GetHistoryItem();
|
| EXPECT_TRUE(first_item);
|
| @@ -7538,7 +7524,7 @@ TEST_P(ParameterizedWebFrameTest,
|
| TEST_P(ParameterizedWebFrameTest, WebNodeImageContents) {
|
| FrameTestHelpers::WebViewHelper web_view_helper;
|
| web_view_helper.InitializeAndLoad("about:blank");
|
| - WebLocalFrame* frame = web_view_helper.WebView()->MainFrameImpl();
|
| + WebLocalFrame* frame = web_view_helper.LocalMainFrame();
|
|
|
| static const char kBluePNG[] =
|
| "<img "
|
| @@ -7686,7 +7672,7 @@ TEST_P(ParameterizedWebFrameTest, FirstBlankSubframeNavigation) {
|
| FrameTestHelpers::WebViewHelper web_view_helper;
|
| web_view_helper.InitializeAndLoad("about:blank", &client);
|
|
|
| - WebLocalFrame* frame = web_view_helper.WebView()->MainFrameImpl();
|
| + WebLocalFrame* frame = web_view_helper.LocalMainFrame();
|
|
|
| frame->ExecuteScript(WebScriptSource(WebString::FromUTF8(
|
| "document.body.appendChild(document.createElement('iframe'))")));
|
| @@ -7715,7 +7701,7 @@ TEST_P(ParameterizedWebFrameTest, FirstNonBlankSubframeNavigation) {
|
| FrameTestHelpers::WebViewHelper web_view_helper;
|
| web_view_helper.InitializeAndLoad("about:blank", &client);
|
|
|
| - WebLocalFrame* frame = web_view_helper.WebView()->MainFrameImpl();
|
| + WebLocalFrame* frame = web_view_helper.LocalMainFrame();
|
|
|
| std::string url1 = base_url_ + "history.html";
|
| FrameTestHelpers::LoadFrame(
|
| @@ -7759,7 +7745,7 @@ TEST_F(WebFrameTest, overflowHiddenRewrite) {
|
| ASSERT_FALSE(web_scroll_layer->UserScrollableVertical());
|
|
|
| // Call javascript to make the layer scrollable, and verify it.
|
| - WebLocalFrameBase* frame = web_view_helper.WebView()->MainFrameImpl();
|
| + WebLocalFrameBase* frame = web_view_helper.LocalMainFrame();
|
| frame->ExecuteScript(WebScriptSource("allowScroll();"));
|
| web_view_helper.WebView()->UpdateAllLifecyclePhases();
|
| ASSERT_TRUE(web_scroll_layer->UserScrollableHorizontal());
|
| @@ -7776,7 +7762,7 @@ TEST_P(ParameterizedWebFrameTest, CurrentHistoryItem) {
|
| web_view_helper.Initialize();
|
| WebLocalFrame* frame = web_view_helper.WebView()->MainFrameImpl();
|
| const FrameLoader& main_frame_loader =
|
| - web_view_helper.WebView()->MainFrameImpl()->GetFrame()->Loader();
|
| + web_view_helper.LocalMainFrame()->GetFrame()->Loader();
|
| WebURLRequest request(ToKURL(url));
|
| frame->LoadRequest(request);
|
|
|
| @@ -7859,8 +7845,7 @@ TEST_P(ParameterizedWebFrameTest, FrameViewMoveWithSetFrameRect) {
|
| web_view_helper.Resize(WebSize(200, 200));
|
| web_view_helper.WebView()->UpdateAllLifecyclePhases();
|
|
|
| - LocalFrameView* frame_view =
|
| - web_view_helper.WebView()->MainFrameImpl()->GetFrameView();
|
| + LocalFrameView* frame_view = web_view_helper.LocalMainFrame()->GetFrameView();
|
| EXPECT_RECT_EQ(IntRect(0, 0, 200, 200), frame_view->FrameRect());
|
| frame_view->SetFrameRect(IntRect(100, 100, 200, 200));
|
| EXPECT_RECT_EQ(IntRect(100, 100, 200, 200), frame_view->FrameRect());
|
| @@ -7874,8 +7859,7 @@ TEST_F(WebFrameTest, FrameViewScrollAccountsForBrowserControls) {
|
| &client, nullptr, ConfigureAndroid);
|
|
|
| WebViewBase* web_view = web_view_helper.WebView();
|
| - LocalFrameView* frame_view =
|
| - web_view_helper.WebView()->MainFrameImpl()->GetFrameView();
|
| + LocalFrameView* frame_view = web_view_helper.LocalMainFrame()->GetFrameView();
|
|
|
| float browser_controls_height = 40;
|
| web_view->ResizeWithBrowserControls(WebSize(100, 100),
|
| @@ -7958,8 +7942,7 @@ TEST_F(WebFrameTest, MaximumScrollPositionCanBeNegative) {
|
| web_view_helper.Resize(WebSize(viewport_width, viewport_height));
|
| web_view_helper.WebView()->UpdateAllLifecyclePhases();
|
|
|
| - LocalFrameView* frame_view =
|
| - web_view_helper.WebView()->MainFrameImpl()->GetFrameView();
|
| + LocalFrameView* frame_view = web_view_helper.LocalMainFrame()->GetFrameView();
|
| EXPECT_LT(frame_view->MaximumScrollOffset().Width(), 0);
|
| }
|
|
|
| @@ -8027,8 +8010,7 @@ TEST_F(WebFrameTest, FullscreenLayerNonScrollable) {
|
| EXPECT_EQ(div_fullscreen, Fullscreen::FullscreenElementFrom(*document));
|
|
|
| // Verify that the viewports are nonscrollable.
|
| - LocalFrameView* frame_view =
|
| - web_view_helper.WebView()->MainFrameImpl()->GetFrameView();
|
| + LocalFrameView* frame_view = web_view_helper.LocalMainFrame()->GetFrameView();
|
| WebLayer* layout_viewport_scroll_layer =
|
| web_view_impl->Compositor()->ScrollLayer()->PlatformLayer();
|
| WebLayer* visual_viewport_scroll_layer =
|
| @@ -8402,7 +8384,7 @@ TEST_P(ParameterizedWebFrameTest, ClearFullscreenConstraintsOnNavigation) {
|
|
|
| // Load a new page before exiting fullscreen.
|
| KURL test_url = ToKURL("about:blank");
|
| - WebLocalFrame* frame = web_view_helper.WebView()->MainFrameImpl();
|
| + WebLocalFrame* frame = web_view_helper.LocalMainFrame();
|
| FrameTestHelpers::LoadHTMLString(frame, kSource, test_url);
|
| web_view_impl->DidExitFullscreen();
|
| web_view_impl->UpdateAllLifecyclePhases();
|
| @@ -8566,7 +8548,7 @@ TEST_P(ParameterizedWebFrameTest, ManifestFetch) {
|
| FrameTestHelpers::WebViewHelper web_view_helper;
|
| web_view_helper.InitializeAndLoad(base_url_ + "foo.html");
|
| Document* document =
|
| - web_view_helper.WebView()->MainFrameImpl()->GetFrame()->GetDocument();
|
| + web_view_helper.LocalMainFrame()->GetFrame()->GetDocument();
|
|
|
| Resource* resource =
|
| FetchManifest(document, ToKURL(base_url_ + "link-manifest-fetch.json"));
|
| @@ -8581,7 +8563,7 @@ TEST_P(ParameterizedWebFrameTest, ManifestCSPFetchAllow) {
|
| FrameTestHelpers::WebViewHelper web_view_helper;
|
| web_view_helper.InitializeAndLoad(base_url_ + "foo.html");
|
| Document* document =
|
| - web_view_helper.WebView()->MainFrameImpl()->GetFrame()->GetDocument();
|
| + web_view_helper.LocalMainFrame()->GetFrame()->GetDocument();
|
|
|
| Resource* resource = FetchManifest(
|
| document, ToKURL(not_base_url_ + "link-manifest-fetch.json"));
|
| @@ -8596,7 +8578,7 @@ TEST_P(ParameterizedWebFrameTest, ManifestCSPFetchSelf) {
|
| FrameTestHelpers::WebViewHelper web_view_helper;
|
| web_view_helper.InitializeAndLoad(base_url_ + "foo.html");
|
| Document* document =
|
| - web_view_helper.WebView()->MainFrameImpl()->GetFrame()->GetDocument();
|
| + web_view_helper.LocalMainFrame()->GetFrame()->GetDocument();
|
|
|
| Resource* resource = FetchManifest(
|
| document, ToKURL(not_base_url_ + "link-manifest-fetch.json"));
|
| @@ -8615,7 +8597,7 @@ TEST_P(ParameterizedWebFrameTest, ManifestCSPFetchSelfReportOnly) {
|
| FrameTestHelpers::WebViewHelper web_view_helper;
|
| web_view_helper.InitializeAndLoad(base_url_ + "foo.html");
|
| Document* document =
|
| - web_view_helper.WebView()->MainFrameImpl()->GetFrame()->GetDocument();
|
| + web_view_helper.LocalMainFrame()->GetFrame()->GetDocument();
|
|
|
| Resource* resource = FetchManifest(
|
| document, ToKURL(not_base_url_ + "link-manifest-fetch.json"));
|
| @@ -8629,7 +8611,7 @@ TEST_P(ParameterizedWebFrameTest, ReloadBypassingCache) {
|
| RegisterMockedHttpURLLoad("foo.html");
|
| FrameTestHelpers::WebViewHelper web_view_helper;
|
| web_view_helper.InitializeAndLoad(base_url_ + "foo.html");
|
| - WebLocalFrame* frame = web_view_helper.WebView()->MainFrameImpl();
|
| + WebLocalFrame* frame = web_view_helper.LocalMainFrame();
|
| FrameTestHelpers::ReloadFrameBypassingCache(frame);
|
| EXPECT_EQ(WebCachePolicy::kBypassingCache,
|
| frame->DataSource()->GetRequest().GetCachePolicy());
|
| @@ -8706,7 +8688,7 @@ TEST_P(ParameterizedWebFrameTest, PrintingBasic)
|
| FrameTestHelpers::WebViewHelper web_view_helper;
|
| web_view_helper.InitializeAndLoad("data:text/html,Hello, world.");
|
|
|
| - WebLocalFrame* frame = web_view_helper.WebView()->MainFrameImpl();
|
| + WebLocalFrame* frame = web_view_helper.LocalMainFrame();
|
|
|
| WebPrintParams print_params;
|
| print_params.print_content_area.width = 500;
|
| @@ -8739,7 +8721,7 @@ TEST_P(ParameterizedWebFrameTest, ThemeColor) {
|
| web_view_helper.InitializeAndLoad(base_url_ + "theme_color_test.html",
|
| &client);
|
| EXPECT_TRUE(client.DidNotify());
|
| - WebLocalFrameBase* frame = web_view_helper.WebView()->MainFrameImpl();
|
| + WebLocalFrameBase* frame = web_view_helper.LocalMainFrame();
|
| EXPECT_EQ(0xff0000ff, frame->GetDocument().ThemeColor());
|
| // Change color by rgb.
|
| client.Reset();
|
| @@ -8791,9 +8773,7 @@ class WebFrameSwapTest : public WebFrameTest {
|
| }
|
|
|
| void Reset() { web_view_helper_.Reset(); }
|
| - WebLocalFrame* MainFrame() const {
|
| - return web_view_helper_.WebView()->MainFrameImpl();
|
| - }
|
| + WebLocalFrame* MainFrame() const { return web_view_helper_.LocalMainFrame(); }
|
| WebViewBase* WebView() const { return web_view_helper_.WebView(); }
|
|
|
| private:
|
| @@ -9696,7 +9676,7 @@ class DeviceEmulationTest : public ParameterizedWebFrameTest {
|
| String code = "dumpSize('" + id + "')";
|
| v8::HandleScope scope(v8::Isolate::GetCurrent());
|
| ScriptExecutionCallbackHelper callback_helper(
|
| - web_view_helper_.WebView()->MainFrameImpl()->MainWorldScriptContext());
|
| + web_view_helper_.LocalMainFrame()->MainWorldScriptContext());
|
| web_view_helper_.WebView()
|
| ->MainFrameImpl()
|
| ->RequestExecuteScriptAndReturnValue(WebScriptSource(WebString(code)),
|
| @@ -10332,7 +10312,7 @@ TEST(WebFrameGlobalReuseTest, MainFrameWithNoOpener) {
|
| FrameTestHelpers::WebViewHelper helper;
|
| helper.Initialize();
|
|
|
| - WebLocalFrame* main_frame = helper.WebView()->MainFrameImpl();
|
| + WebLocalFrame* main_frame = helper.LocalMainFrame();
|
| v8::HandleScope scope(v8::Isolate::GetCurrent());
|
| main_frame->ExecuteScript(WebScriptSource("hello = 'world';"));
|
| FrameTestHelpers::LoadFrame(main_frame, "data:text/html,new page");
|
| @@ -10349,7 +10329,7 @@ TEST(WebFrameGlobalReuseTest, ChildFrame) {
|
| helper.Initialize(nullptr, nullptr, nullptr,
|
| EnableGlobalReuseForUnownedMainFrames);
|
|
|
| - WebLocalFrame* main_frame = helper.WebView()->MainFrameImpl();
|
| + WebLocalFrame* main_frame = helper.LocalMainFrame();
|
| FrameTestHelpers::LoadFrame(main_frame, "data:text/html,<iframe></iframe>");
|
|
|
| WebLocalFrame* child_frame = main_frame->FirstChild()->ToWebLocalFrame();
|
| @@ -10372,7 +10352,7 @@ TEST(WebFrameGlobalReuseTest, MainFrameWithOpener) {
|
| nullptr, nullptr,
|
| EnableGlobalReuseForUnownedMainFrames);
|
|
|
| - WebLocalFrame* main_frame = helper.WebView()->MainFrameImpl();
|
| + WebLocalFrame* main_frame = helper.LocalMainFrame();
|
| v8::HandleScope scope(v8::Isolate::GetCurrent());
|
| main_frame->ExecuteScript(WebScriptSource("hello = 'world';"));
|
| FrameTestHelpers::LoadFrame(main_frame, "data:text/html,new page");
|
| @@ -10391,7 +10371,7 @@ TEST(WebFrameGlobalReuseTest, ReuseForMainFrameIfEnabled) {
|
| helper.Initialize(nullptr, nullptr, nullptr,
|
| EnableGlobalReuseForUnownedMainFrames);
|
|
|
| - WebLocalFrame* main_frame = helper.WebView()->MainFrameImpl();
|
| + WebLocalFrame* main_frame = helper.LocalMainFrame();
|
| v8::HandleScope scope(v8::Isolate::GetCurrent());
|
| main_frame->ExecuteScript(WebScriptSource("hello = 'world';"));
|
| FrameTestHelpers::LoadFrame(main_frame, "data:text/html,new page");
|
| @@ -10582,7 +10562,7 @@ TEST_F(WebFrameTest, LoadJavascriptURLInNewFrame) {
|
| URLTestHelpers::RegisterMockedURLLoad(ToKURL(redirect_url),
|
| testing::WebTestDataPath("foo.html"));
|
| WebURLRequest request(ToKURL("javascript:location='" + redirect_url + "'"));
|
| - helper.WebView()->MainFrameImpl()->LoadRequest(request);
|
| + helper.LocalMainFrame()->LoadRequest(request);
|
|
|
| // Normally, the result of the JS url replaces the existing contents on the
|
| // Document. However, if the JS triggers a navigation, the contents should
|
| @@ -11546,7 +11526,7 @@ TEST_F(WebFrameTest, DISABLE_ON_TSAN(TestNonCompositedOverlayScrollbarsFade)) {
|
| base_url);
|
| web_view_impl->UpdateAllLifecyclePhases();
|
|
|
| - WebLocalFrameBase* frame = web_view_helper.WebView()->MainFrameImpl();
|
| + WebLocalFrameBase* frame = web_view_helper.LocalMainFrame();
|
| Document* document =
|
| ToLocalFrame(web_view_impl->GetPage()->MainFrame())->GetDocument();
|
| Element* container = document->getElementById("container");
|
| @@ -11794,7 +11774,7 @@ TEST_F(WebFrameTest, ClearClosedOpener) {
|
| helper.InitializeWithOpener(opener_helper.WebView()->MainFrame());
|
|
|
| opener_helper.Reset();
|
| - EXPECT_EQ(nullptr, helper.WebView()->MainFrameImpl()->Opener());
|
| + EXPECT_EQ(nullptr, helper.LocalMainFrame()->Opener());
|
| }
|
|
|
| class ShowVirtualKeyboardObserverWidgetClient
|
| @@ -11970,7 +11950,7 @@ TEST_F(WebFrameTest, FallbackForNonexistentProvisionalNavigation) {
|
| FrameTestHelpers::WebViewHelper web_view_helper_;
|
| web_view_helper_.Initialize(&main_client);
|
|
|
| - WebLocalFrameBase* main_frame = web_view_helper_.WebView()->MainFrameImpl();
|
| + WebLocalFrameBase* main_frame = web_view_helper_.LocalMainFrame();
|
| WebURLRequest request(ToKURL(base_url_ + "fallback.html"));
|
| main_frame->LoadRequest(request);
|
|
|
| @@ -11995,7 +11975,7 @@ TEST_F(WebFrameTest, AltTextOnAboutBlankPage) {
|
| FrameTestHelpers::WebViewHelper web_view_helper;
|
| web_view_helper.InitializeAndLoad("about:blank");
|
| web_view_helper.Resize(WebSize(640, 480));
|
| - WebLocalFrameBase* frame = web_view_helper.WebView()->MainFrameImpl();
|
| + WebLocalFrameBase* frame = web_view_helper.LocalMainFrame();
|
|
|
| const char kSource[] =
|
| "<img id='foo' src='foo' alt='foo alt' width='200' height='200'>";
|
|
|