Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(637)

Side by Side Diff: third_party/WebKit/Source/web/tests/WebFrameTest.cpp

Issue 2017893002: [Binding] [Refactoring] Use SerializedScriptValue class as external interface (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix build error Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/web/WebSerializedScriptValue.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/web/WebSerializedScriptValue.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698