| OLD | NEW |
| 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 16 matching lines...) Expand all Loading... |
| 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 "config.h" | 31 #include "config.h" |
| 32 | 32 |
| 33 #include "public/web/WebFrame.h" | 33 #include "public/web/WebFrame.h" |
| 34 | 34 |
| 35 #include "SkBitmap.h" | 35 #include "SkBitmap.h" |
| 36 #include "SkCanvas.h" | 36 #include "SkCanvas.h" |
| 37 #include "bindings/core/v8/SerializedScriptValueFactory.h" |
| 37 #include "bindings/core/v8/V8Node.h" | 38 #include "bindings/core/v8/V8Node.h" |
| 38 #include "core/UserAgentStyleSheets.h" | 39 #include "core/UserAgentStyleSheets.h" |
| 39 #include "core/clipboard/DataTransfer.h" | 40 #include "core/clipboard/DataTransfer.h" |
| 40 #include "core/css/StyleSheetContents.h" | 41 #include "core/css/StyleSheetContents.h" |
| 41 #include "core/css/resolver/StyleResolver.h" | 42 #include "core/css/resolver/StyleResolver.h" |
| 42 #include "core/css/resolver/ViewportStyleResolver.h" | 43 #include "core/css/resolver/ViewportStyleResolver.h" |
| 43 #include "core/dom/DocumentMarkerController.h" | 44 #include "core/dom/DocumentMarkerController.h" |
| 44 #include "core/dom/Fullscreen.h" | 45 #include "core/dom/Fullscreen.h" |
| 45 #include "core/dom/NodeRenderStyle.h" | 46 #include "core/dom/NodeRenderStyle.h" |
| 46 #include "core/dom/Range.h" | 47 #include "core/dom/Range.h" |
| (...skipping 618 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 665 EXPECT_EQ(std::string::npos, content.find("Message 2.")); | 666 EXPECT_EQ(std::string::npos, content.find("Message 2.")); |
| 666 } | 667 } |
| 667 | 668 |
| 668 TEST_F(WebFrameTest, PostMessageThenDetach) | 669 TEST_F(WebFrameTest, PostMessageThenDetach) |
| 669 { | 670 { |
| 670 FrameTestHelpers::WebViewHelper webViewHelper; | 671 FrameTestHelpers::WebViewHelper webViewHelper; |
| 671 webViewHelper.initializeAndLoad("about:blank"); | 672 webViewHelper.initializeAndLoad("about:blank"); |
| 672 | 673 |
| 673 RefPtrWillBeRawPtr<LocalFrame> frame = toLocalFrame(webViewHelper.webViewImp
l()->page()->mainFrame()); | 674 RefPtrWillBeRawPtr<LocalFrame> frame = toLocalFrame(webViewHelper.webViewImp
l()->page()->mainFrame()); |
| 674 NonThrowableExceptionState exceptionState; | 675 NonThrowableExceptionState exceptionState; |
| 675 frame->domWindow()->postMessage(SerializedScriptValue::create("message"), 0,
"*", frame->localDOMWindow(), exceptionState); | 676 frame->domWindow()->postMessage(SerializedScriptValueFactory::factory().crea
te("message"), 0, "*", frame->localDOMWindow(), exceptionState); |
| 676 webViewHelper.reset(); | 677 webViewHelper.reset(); |
| 677 EXPECT_FALSE(exceptionState.hadException()); | 678 EXPECT_FALSE(exceptionState.hadException()); |
| 678 | 679 |
| 679 // Success is not crashing. | 680 // Success is not crashing. |
| 680 runPendingTasks(); | 681 runPendingTasks(); |
| 681 } | 682 } |
| 682 | 683 |
| 683 class FixedLayoutTestWebViewClient : public FrameTestHelpers::TestWebViewClient
{ | 684 class FixedLayoutTestWebViewClient : public FrameTestHelpers::TestWebViewClient
{ |
| 684 public: | 685 public: |
| 685 virtual WebScreenInfo screenInfo() override { return m_screenInfo; } | 686 virtual WebScreenInfo screenInfo() override { return m_screenInfo; } |
| (...skipping 6230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6916 EXPECT_EQ(1u, frameClient.navigationalDataReceivedCount()); | 6917 EXPECT_EQ(1u, frameClient.navigationalDataReceivedCount()); |
| 6917 | 6918 |
| 6918 // Neither should a page reload. | 6919 // Neither should a page reload. |
| 6919 localFrame->reload(); | 6920 localFrame->reload(); |
| 6920 EXPECT_EQ(4u, frameClient.provisionalLoadCount()); | 6921 EXPECT_EQ(4u, frameClient.provisionalLoadCount()); |
| 6921 EXPECT_FALSE(frameClient.wasLastProvisionalLoadATransition()); | 6922 EXPECT_FALSE(frameClient.wasLastProvisionalLoadATransition()); |
| 6922 EXPECT_EQ(1u, frameClient.navigationalDataReceivedCount()); | 6923 EXPECT_EQ(1u, frameClient.navigationalDataReceivedCount()); |
| 6923 } | 6924 } |
| 6924 | 6925 |
| 6925 } // namespace | 6926 } // namespace |
| OLD | NEW |