| 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 826 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 837 } | 837 } |
| 838 | 838 |
| 839 TEST_P(ParameterizedWebFrameTest, PostMessageThenDetach) | 839 TEST_P(ParameterizedWebFrameTest, PostMessageThenDetach) |
| 840 { | 840 { |
| 841 FrameTestHelpers::WebViewHelper webViewHelper(this); | 841 FrameTestHelpers::WebViewHelper webViewHelper(this); |
| 842 webViewHelper.initializeAndLoad("about:blank"); | 842 webViewHelper.initializeAndLoad("about:blank"); |
| 843 | 843 |
| 844 LocalFrame* frame = toLocalFrame(webViewHelper.webViewImpl()->page()->mainFr
ame()); | 844 LocalFrame* frame = toLocalFrame(webViewHelper.webViewImpl()->page()->mainFr
ame()); |
| 845 NonThrowableExceptionState exceptionState; | 845 NonThrowableExceptionState exceptionState; |
| 846 MessagePortArray messagePorts; | 846 MessagePortArray messagePorts; |
| 847 frame->domWindow()->postMessage(SerializedScriptValueFactory::instance().cre
ate("message"), messagePorts, "*", frame->localDOMWindow(), exceptionState); | 847 frame->domWindow()->postMessage(SerializedScriptValue::serialize("message"),
messagePorts, "*", frame->localDOMWindow(), exceptionState); |
| 848 webViewHelper.reset(); | 848 webViewHelper.reset(); |
| 849 EXPECT_FALSE(exceptionState.hadException()); | 849 EXPECT_FALSE(exceptionState.hadException()); |
| 850 | 850 |
| 851 // Success is not crashing. | 851 // Success is not crashing. |
| 852 runPendingTasks(); | 852 runPendingTasks(); |
| 853 } | 853 } |
| 854 | 854 |
| 855 namespace { | 855 namespace { |
| 856 | 856 |
| 857 class FixedLayoutTestWebViewClient : public FrameTestHelpers::TestWebViewClient
{ | 857 class FixedLayoutTestWebViewClient : public FrameTestHelpers::TestWebViewClient
{ |
| (...skipping 7826 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8684 WebLocalFrame* mainFrame = helper.webView()->mainFrame()->toWebLocalFrame(); | 8684 WebLocalFrame* mainFrame = helper.webView()->mainFrame()->toWebLocalFrame(); |
| 8685 v8::HandleScope scope(v8::Isolate::GetCurrent()); | 8685 v8::HandleScope scope(v8::Isolate::GetCurrent()); |
| 8686 mainFrame->executeScript(WebScriptSource("hello = 'world';")); | 8686 mainFrame->executeScript(WebScriptSource("hello = 'world';")); |
| 8687 FrameTestHelpers::loadFrame(mainFrame, "data:text/html,new page"); | 8687 FrameTestHelpers::loadFrame(mainFrame, "data:text/html,new page"); |
| 8688 v8::Local<v8::Value> result = mainFrame->executeScriptAndReturnValue(WebScri
ptSource("hello")); | 8688 v8::Local<v8::Value> result = mainFrame->executeScriptAndReturnValue(WebScri
ptSource("hello")); |
| 8689 ASSERT_TRUE(result->IsString()); | 8689 ASSERT_TRUE(result->IsString()); |
| 8690 EXPECT_EQ("world", toCoreString(result->ToString(mainFrame->mainWorldScriptC
ontext()).ToLocalChecked())); | 8690 EXPECT_EQ("world", toCoreString(result->ToString(mainFrame->mainWorldScriptC
ontext()).ToLocalChecked())); |
| 8691 } | 8691 } |
| 8692 | 8692 |
| 8693 } // namespace blink | 8693 } // namespace blink |
| OLD | NEW |