| 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 824 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 835 EXPECT_EQ(std::string::npos, content.find("Message 2.")); | 835 EXPECT_EQ(std::string::npos, content.find("Message 2.")); |
| 836 } | 836 } |
| 837 | 837 |
| 838 TEST_P(ParameterizedWebFrameTest, PostMessageThenDetach) | 838 TEST_P(ParameterizedWebFrameTest, PostMessageThenDetach) |
| 839 { | 839 { |
| 840 FrameTestHelpers::WebViewHelper webViewHelper(this); | 840 FrameTestHelpers::WebViewHelper webViewHelper(this); |
| 841 webViewHelper.initializeAndLoad("about:blank"); | 841 webViewHelper.initializeAndLoad("about:blank"); |
| 842 | 842 |
| 843 LocalFrame* frame = toLocalFrame(webViewHelper.webViewImpl()->page()->mainFr
ame()); | 843 LocalFrame* frame = toLocalFrame(webViewHelper.webViewImpl()->page()->mainFr
ame()); |
| 844 NonThrowableExceptionState exceptionState; | 844 NonThrowableExceptionState exceptionState; |
| 845 frame->domWindow()->postMessage(SerializedScriptValueFactory::instance().cre
ate("message"), 0, "*", frame->localDOMWindow(), exceptionState); | 845 MessagePortArray messagePorts; |
| 846 frame->domWindow()->postMessage(SerializedScriptValueFactory::instance().cre
ate("message"), messagePorts, "*", frame->localDOMWindow(), exceptionState); |
| 846 webViewHelper.reset(); | 847 webViewHelper.reset(); |
| 847 EXPECT_FALSE(exceptionState.hadException()); | 848 EXPECT_FALSE(exceptionState.hadException()); |
| 848 | 849 |
| 849 // Success is not crashing. | 850 // Success is not crashing. |
| 850 runPendingTasks(); | 851 runPendingTasks(); |
| 851 } | 852 } |
| 852 | 853 |
| 853 namespace { | 854 namespace { |
| 854 | 855 |
| 855 class FixedLayoutTestWebViewClient : public FrameTestHelpers::TestWebViewClient
{ | 856 class FixedLayoutTestWebViewClient : public FrameTestHelpers::TestWebViewClient
{ |
| (...skipping 7759 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8615 WebLocalFrame* mainFrame = helper.webView()->mainFrame()->toWebLocalFrame(); | 8616 WebLocalFrame* mainFrame = helper.webView()->mainFrame()->toWebLocalFrame(); |
| 8616 v8::HandleScope scope(v8::Isolate::GetCurrent()); | 8617 v8::HandleScope scope(v8::Isolate::GetCurrent()); |
| 8617 mainFrame->executeScript(WebScriptSource("hello = 'world';")); | 8618 mainFrame->executeScript(WebScriptSource("hello = 'world';")); |
| 8618 FrameTestHelpers::loadFrame(mainFrame, "data:text/html,new page"); | 8619 FrameTestHelpers::loadFrame(mainFrame, "data:text/html,new page"); |
| 8619 v8::Local<v8::Value> result = mainFrame->executeScriptAndReturnValue(WebScri
ptSource("hello")); | 8620 v8::Local<v8::Value> result = mainFrame->executeScriptAndReturnValue(WebScri
ptSource("hello")); |
| 8620 ASSERT_TRUE(result->IsString()); | 8621 ASSERT_TRUE(result->IsString()); |
| 8621 EXPECT_EQ("world", toCoreString(result->ToString(mainFrame->mainWorldScriptC
ontext()).ToLocalChecked())); | 8622 EXPECT_EQ("world", toCoreString(result->ToString(mainFrame->mainWorldScriptC
ontext()).ToLocalChecked())); |
| 8622 } | 8623 } |
| 8623 | 8624 |
| 8624 } // namespace blink | 8625 } // namespace blink |
| OLD | NEW |