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

Side by Side Diff: third_party/WebKit/Source/web/tests/WebFrameTest.cpp

Issue 2907663004: FrameTree::Find only searches relative to local frames. (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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 #include "public/web/WebSettings.h" 148 #include "public/web/WebSettings.h"
149 #include "public/web/WebTextCheckClient.h" 149 #include "public/web/WebTextCheckClient.h"
150 #include "public/web/WebTextCheckingCompletion.h" 150 #include "public/web/WebTextCheckingCompletion.h"
151 #include "public/web/WebTextCheckingResult.h" 151 #include "public/web/WebTextCheckingResult.h"
152 #include "public/web/WebViewClient.h" 152 #include "public/web/WebViewClient.h"
153 #include "testing/gmock/include/gmock/gmock.h" 153 #include "testing/gmock/include/gmock/gmock.h"
154 #include "testing/gtest/include/gtest/gtest.h" 154 #include "testing/gtest/include/gtest/gtest.h"
155 #include "v8/include/v8.h" 155 #include "v8/include/v8.h"
156 #include "web/TextFinder.h" 156 #include "web/TextFinder.h"
157 #include "web/WebRemoteFrameImpl.h" 157 #include "web/WebRemoteFrameImpl.h"
158 #include "web/WebViewImpl.h"
158 #include "web/tests/FrameTestHelpers.h" 159 #include "web/tests/FrameTestHelpers.h"
159 #include "web/tests/sim/SimDisplayItemList.h" 160 #include "web/tests/sim/SimDisplayItemList.h"
160 #include "web/tests/sim/SimRequest.h" 161 #include "web/tests/sim/SimRequest.h"
161 #include "web/tests/sim/SimTest.h" 162 #include "web/tests/sim/SimTest.h"
162 163
163 using blink::URLTestHelpers::ToKURL; 164 using blink::URLTestHelpers::ToKURL;
164 using blink::testing::RunPendingTasks; 165 using blink::testing::RunPendingTasks;
165 using testing::ElementsAre; 166 using testing::ElementsAre;
166 using testing::Mock; 167 using testing::Mock;
167 using testing::_; 168 using testing::_;
(...skipping 4204 matching lines...) Expand 10 before | Expand all | Expand 10 after
4372 RegisterMockedHttpURLLoad("iframe_redirect.html"); 4373 RegisterMockedHttpURLLoad("iframe_redirect.html");
4373 RegisterMockedHttpURLLoad("visible_iframe.html"); 4374 RegisterMockedHttpURLLoad("visible_iframe.html");
4374 4375
4375 FrameTestHelpers::WebViewHelper web_view_helper; 4376 FrameTestHelpers::WebViewHelper web_view_helper;
4376 web_view_helper.InitializeAndLoad(base_url_ + "iframe_redirect.html", true); 4377 web_view_helper.InitializeAndLoad(base_url_ + "iframe_redirect.html", true);
4377 // Pump pending requests one more time. The test page loads script that 4378 // Pump pending requests one more time. The test page loads script that
4378 // navigates. 4379 // navigates.
4379 FrameTestHelpers::PumpPendingRequestsForFrameToLoad( 4380 FrameTestHelpers::PumpPendingRequestsForFrameToLoad(
4380 web_view_helper.WebView()->MainFrame()); 4381 web_view_helper.WebView()->MainFrame());
4381 4382
4382 WebFrame* iframe = web_view_helper.WebView()->FindFrameByName( 4383 WebFrame* iframe =
4383 WebString::FromUTF8("ifr"), nullptr); 4384 web_view_helper.WebView()->MainFrameImpl()->FindFrameByName(
4385 WebString::FromUTF8("ifr"));
4384 ASSERT_TRUE(iframe); 4386 ASSERT_TRUE(iframe);
4385 WebDataSource* iframe_data_source = iframe->DataSource(); 4387 WebDataSource* iframe_data_source = iframe->DataSource();
4386 ASSERT_TRUE(iframe_data_source); 4388 ASSERT_TRUE(iframe_data_source);
4387 WebVector<WebURL> redirects; 4389 WebVector<WebURL> redirects;
4388 iframe_data_source->RedirectChain(redirects); 4390 iframe_data_source->RedirectChain(redirects);
4389 ASSERT_EQ(2U, redirects.size()); 4391 ASSERT_EQ(2U, redirects.size());
4390 EXPECT_EQ(ToKURL("about:blank"), KURL(redirects[0])); 4392 EXPECT_EQ(ToKURL("about:blank"), KURL(redirects[0]));
4391 EXPECT_EQ(ToKURL("http://internal.test/visible_iframe.html"), 4393 EXPECT_EQ(ToKURL("http://internal.test/visible_iframe.html"),
4392 KURL(redirects[1])); 4394 KURL(redirects[1]));
4393 } 4395 }
(...skipping 7784 matching lines...) Expand 10 before | Expand all | Expand 10 after
12178 if (obj->IsText()) { 12180 if (obj->IsText()) {
12179 LayoutText* layout_text = ToLayoutText(obj); 12181 LayoutText* layout_text = ToLayoutText(obj);
12180 text = layout_text->GetText(); 12182 text = layout_text->GetText();
12181 break; 12183 break;
12182 } 12184 }
12183 } 12185 }
12184 EXPECT_EQ("foo alt", text.Utf8()); 12186 EXPECT_EQ("foo alt", text.Utf8());
12185 } 12187 }
12186 12188
12187 } // namespace blink 12189 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/web/tests/LayoutGeometryMapTest.cpp ('k') | third_party/WebKit/public/web/WebLocalFrame.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698