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

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

Issue 2940863005: Move loading methods from WebFrame to WebLocalFrame. (Closed)
Patch Set: Fixing build problems introduced by 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) 2014 Google Inc. All rights reserved. 2 * Copyright (C) 2014 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 16 matching lines...) Expand all
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */ 29 */
30 30
31 #include "core/dom/Document.h" 31 #include "core/dom/Document.h"
32 #include "core/dom/Element.h" 32 #include "core/dom/Element.h"
33 #include "core/dom/shadow/ElementShadow.h" 33 #include "core/dom/shadow/ElementShadow.h"
34 #include "core/frame/FrameTestHelpers.h" 34 #include "core/frame/FrameTestHelpers.h"
35 #include "core/frame/LocalFrame.h" 35 #include "core/frame/LocalFrame.h"
36 #include "core/frame/Location.h" 36 #include "core/frame/Location.h"
37 #include "core/frame/WebLocalFrameBase.h"
37 #include "core/page/Page.h" 38 #include "core/page/Page.h"
38 #include "platform/SerializedResource.h" 39 #include "platform/SerializedResource.h"
39 #include "platform/SharedBuffer.h" 40 #include "platform/SharedBuffer.h"
40 #include "platform/mhtml/MHTMLArchive.h" 41 #include "platform/mhtml/MHTMLArchive.h"
41 #include "platform/mhtml/MHTMLParser.h" 42 #include "platform/mhtml/MHTMLParser.h"
42 #include "platform/testing/URLTestHelpers.h" 43 #include "platform/testing/URLTestHelpers.h"
43 #include "platform/testing/UnitTestHelpers.h" 44 #include "platform/testing/UnitTestHelpers.h"
44 #include "platform/weborigin/KURL.h" 45 #include "platform/weborigin/KURL.h"
45 #include "platform/weborigin/SchemeRegistry.h" 46 #include "platform/weborigin/SchemeRegistry.h"
46 #include "public/platform/Platform.h" 47 #include "public/platform/Platform.h"
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 99
99 void RegisterMockedURLLoad(const std::string& url, 100 void RegisterMockedURLLoad(const std::string& url,
100 const std::string& file_name) { 101 const std::string& file_name) {
101 URLTestHelpers::RegisterMockedURLLoad( 102 URLTestHelpers::RegisterMockedURLLoad(
102 ToKURL(url), 103 ToKURL(url),
103 testing::WebTestDataPath(WebString::FromUTF8("mhtml/" + file_name)), 104 testing::WebTestDataPath(WebString::FromUTF8("mhtml/" + file_name)),
104 WebString::FromUTF8("multipart/related")); 105 WebString::FromUTF8("multipart/related"));
105 } 106 }
106 107
107 void LoadURLInTopFrame(const WebURL& url) { 108 void LoadURLInTopFrame(const WebURL& url) {
108 FrameTestHelpers::LoadFrame(helper_.WebView()->MainFrame(), 109 FrameTestHelpers::LoadFrame(helper_.WebView()->MainFrameImpl(),
109 url.GetString().Utf8().data()); 110 url.GetString().Utf8().data());
110 } 111 }
111 112
112 Page* GetPage() const { return helper_.WebView()->GetPage(); } 113 Page* GetPage() const { return helper_.WebView()->GetPage(); }
113 114
114 void AddResource(const char* url, 115 void AddResource(const char* url,
115 const char* mime, 116 const char* mime,
116 PassRefPtr<SharedBuffer> data) { 117 PassRefPtr<SharedBuffer> data) {
117 SerializedResource resource(ToKURL(url), mime, std::move(data)); 118 SerializedResource resource(ToKURL(url), mime, std::move(data));
118 resources_.push_back(resource); 119 resources_.push_back(resource);
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
330 .getElementById("s1")); 331 .getElementById("s1"));
331 // The element to be created by the script in the shadow dom template is 332 // The element to be created by the script in the shadow dom template is
332 // not found because the script is blocked. 333 // not found because the script is blocked.
333 EXPECT_FALSE(document->getElementById("h4") 334 EXPECT_FALSE(document->getElementById("h4")
334 ->Shadow() 335 ->Shadow()
335 ->OldestShadowRoot() 336 ->OldestShadowRoot()
336 .getElementById("s2")); 337 .getElementById("s2"));
337 } 338 }
338 339
339 } // namespace blink 340 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698