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

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

Issue 2165573003: Simplify tests by using Web*Impl types directly. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 void registerMockedURLLoad(const std::string& url, const WebString& fileName ) 105 void registerMockedURLLoad(const std::string& url, const WebString& fileName )
106 { 106 {
107 URLTestHelpers::registerMockedURLLoad(toKURL(url), fileName, WebString:: fromUTF8("mhtml/"), WebString::fromUTF8("text/html")); 107 URLTestHelpers::registerMockedURLLoad(toKURL(url), fileName, WebString:: fromUTF8("mhtml/"), WebString::fromUTF8("text/html"));
108 } 108 }
109 109
110 void loadURLInTopFrame(const WebURL& url) 110 void loadURLInTopFrame(const WebURL& url)
111 { 111 {
112 FrameTestHelpers::loadFrame(m_helper.webView()->mainFrame(), url.string( ).utf8().data()); 112 FrameTestHelpers::loadFrame(m_helper.webView()->mainFrame(), url.string( ).utf8().data());
113 } 113 }
114 114
115 Page* page() const { return m_helper.webViewImpl()->page(); } 115 Page* page() const { return m_helper.webView()->page(); }
116 116
117 117
118 void addResource(const char* url, const char* mime, PassRefPtr<SharedBuffer> data) 118 void addResource(const char* url, const char* mime, PassRefPtr<SharedBuffer> data)
119 { 119 {
120 SerializedResource resource(toKURL(url), mime, data); 120 SerializedResource resource(toKURL(url), mime, data);
121 m_resources.append(resource); 121 m_resources.append(resource);
122 } 122 }
123 123
124 void addResource(const char* url, const char* mime, const char* fileName) 124 void addResource(const char* url, const char* mime, const char* fileName)
125 { 125 {
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 245
246 // MHTMLArchives can be initialized from any local scheme, but never a remot e scheme. 246 // MHTMLArchives can be initialized from any local scheme, but never a remot e scheme.
247 EXPECT_EQ(nullptr, MHTMLArchive::create(httpURL, data.get())); 247 EXPECT_EQ(nullptr, MHTMLArchive::create(httpURL, data.get()));
248 EXPECT_NE(nullptr, MHTMLArchive::create(fileURL, data.get())); 248 EXPECT_NE(nullptr, MHTMLArchive::create(fileURL, data.get()));
249 EXPECT_EQ(nullptr, MHTMLArchive::create(specialSchemeURL, data.get())); 249 EXPECT_EQ(nullptr, MHTMLArchive::create(specialSchemeURL, data.get()));
250 SchemeRegistry::registerURLSchemeAsLocal("fooscheme"); 250 SchemeRegistry::registerURLSchemeAsLocal("fooscheme");
251 EXPECT_NE(nullptr, MHTMLArchive::create(specialSchemeURL, data.get())); 251 EXPECT_NE(nullptr, MHTMLArchive::create(specialSchemeURL, data.get()));
252 } 252 }
253 253
254 } // namespace blink 254 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698