| 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 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 FrameTestHelpers::loadFrame(m_helper.webView()->mainFrame(), | 108 FrameTestHelpers::loadFrame(m_helper.webView()->mainFrame(), |
| 109 url.string().utf8().data()); | 109 url.string().utf8().data()); |
| 110 } | 110 } |
| 111 | 111 |
| 112 Page* page() const { return m_helper.webView()->page(); } | 112 Page* page() const { return m_helper.webView()->page(); } |
| 113 | 113 |
| 114 void addResource(const char* url, | 114 void addResource(const char* url, |
| 115 const char* mime, | 115 const char* mime, |
| 116 PassRefPtr<SharedBuffer> data) { | 116 PassRefPtr<SharedBuffer> data) { |
| 117 SerializedResource resource(toKURL(url), mime, data); | 117 SerializedResource resource(toKURL(url), mime, data); |
| 118 m_resources.append(resource); | 118 m_resources.push_back(resource); |
| 119 } | 119 } |
| 120 | 120 |
| 121 void addResource(const char* url, const char* mime, const char* fileName) { | 121 void addResource(const char* url, const char* mime, const char* fileName) { |
| 122 addResource(url, mime, readFile(fileName)); | 122 addResource(url, mime, readFile(fileName)); |
| 123 } | 123 } |
| 124 | 124 |
| 125 void addTestResources() { | 125 void addTestResources() { |
| 126 addResource("http://www.test.com", "text/html", "css_test_page.html"); | 126 addResource("http://www.test.com", "text/html", "css_test_page.html"); |
| 127 addResource("http://www.test.com/link_styles.css", "text/css", | 127 addResource("http://www.test.com/link_styles.css", "text/css", |
| 128 "link_styles.css"); | 128 "link_styles.css"); |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 281 // Full sandboxing should be turned on. | 281 // Full sandboxing should be turned on. |
| 282 EXPECT_TRUE(document->isSandboxed(SandboxAll)); | 282 EXPECT_TRUE(document->isSandboxed(SandboxAll)); |
| 283 | 283 |
| 284 // MHTML document should be loaded into unique origin. | 284 // MHTML document should be loaded into unique origin. |
| 285 EXPECT_TRUE(document->getSecurityOrigin()->isUnique()); | 285 EXPECT_TRUE(document->getSecurityOrigin()->isUnique()); |
| 286 // Script execution should be disabled. | 286 // Script execution should be disabled. |
| 287 EXPECT_FALSE(frame->script().canExecuteScripts(NotAboutToExecuteScript)); | 287 EXPECT_FALSE(frame->script().canExecuteScripts(NotAboutToExecuteScript)); |
| 288 } | 288 } |
| 289 | 289 |
| 290 } // namespace blink | 290 } // namespace blink |
| OLD | NEW |