OLD | NEW |
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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 Platform::current()->unitTestSupport()->unregisterAllMockedURLs(); | 75 Platform::current()->unitTestSupport()->unregisterAllMockedURLs(); |
76 } | 76 } |
77 | 77 |
78 void registerMockedURLLoad(const std::string& url, const WebString& fileName
) | 78 void registerMockedURLLoad(const std::string& url, const WebString& fileName
) |
79 { | 79 { |
80 URLTestHelpers::registerMockedURLLoad(toKURL(url), fileName, WebString::
fromUTF8("mhtml/"), WebString::fromUTF8("text/html")); | 80 URLTestHelpers::registerMockedURLLoad(toKURL(url), fileName, WebString::
fromUTF8("mhtml/"), WebString::fromUTF8("text/html")); |
81 } | 81 } |
82 | 82 |
83 void loadURLInTopFrame(const WebURL& url) | 83 void loadURLInTopFrame(const WebURL& url) |
84 { | 84 { |
85 FrameTestHelpers::loadFrame(m_helper.webView()->mainFrame(), url.string(
).utf8().data()); | 85 WebURLRequest urlRequest; |
| 86 urlRequest.initialize(); |
| 87 urlRequest.setURL(url); |
| 88 m_helper.webView()->mainFrame()->loadRequest(urlRequest); |
| 89 // Make sure any pending request get served. |
| 90 Platform::current()->unitTestSupport()->serveAsynchronousMockedRequests(
); |
86 } | 91 } |
87 | 92 |
88 Page* page() const { return m_helper.webViewImpl()->page(); } | 93 Page* page() const { return m_helper.webViewImpl()->page(); } |
89 | 94 |
90 private: | 95 private: |
91 FrameTestHelpers::WebViewHelper m_helper; | 96 FrameTestHelpers::WebViewHelper m_helper; |
92 }; | 97 }; |
93 | 98 |
94 // Checks that the domain is set to the actual MHTML file, not the URL it was | 99 // Checks that the domain is set to the actual MHTML file, not the URL it was |
95 // generated from. | 100 // generated from. |
(...skipping 11 matching lines...) Expand all Loading... |
107 Document* document = frame->document(); | 112 Document* document = frame->document(); |
108 ASSERT_TRUE(document); | 113 ASSERT_TRUE(document); |
109 | 114 |
110 EXPECT_STREQ(kFileURL, frame->domWindow()->location().href().ascii().data())
; | 115 EXPECT_STREQ(kFileURL, frame->domWindow()->location().href().ascii().data())
; |
111 | 116 |
112 WebCore::SecurityOrigin* origin = document->securityOrigin(); | 117 WebCore::SecurityOrigin* origin = document->securityOrigin(); |
113 EXPECT_STRNE("localhost", origin->domain().ascii().data()); | 118 EXPECT_STRNE("localhost", origin->domain().ascii().data()); |
114 } | 119 } |
115 | 120 |
116 } | 121 } |
OLD | NEW |