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

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

Issue 683013002: Extract a DOMWindow interface from LocalDOMWindow and use it in the idl. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix incorrect assumption Created 6 years, 1 month 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 | Annotate | Revision Log
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 650 matching lines...) Expand 10 before | Expand all | Expand 10 after
661 EXPECT_EQ(std::string::npos, content.find("Message 2.")); 661 EXPECT_EQ(std::string::npos, content.find("Message 2."));
662 } 662 }
663 663
664 TEST_F(WebFrameTest, PostMessageThenDetach) 664 TEST_F(WebFrameTest, PostMessageThenDetach)
665 { 665 {
666 FrameTestHelpers::WebViewHelper webViewHelper; 666 FrameTestHelpers::WebViewHelper webViewHelper;
667 webViewHelper.initializeAndLoad("about:blank"); 667 webViewHelper.initializeAndLoad("about:blank");
668 668
669 RefPtrWillBeRawPtr<LocalFrame> frame = toLocalFrame(webViewHelper.webViewImp l()->page()->mainFrame()); 669 RefPtrWillBeRawPtr<LocalFrame> frame = toLocalFrame(webViewHelper.webViewImp l()->page()->mainFrame());
670 NonThrowableExceptionState exceptionState; 670 NonThrowableExceptionState exceptionState;
671 frame->domWindow()->postMessage(SerializedScriptValue::create("message"), 0, "*", frame->domWindow(), exceptionState); 671 frame->domWindow()->postMessage(SerializedScriptValue::create("message"), 0, "*", frame->localDOMWindow(), exceptionState);
672 webViewHelper.reset(); 672 webViewHelper.reset();
673 EXPECT_FALSE(exceptionState.hadException()); 673 EXPECT_FALSE(exceptionState.hadException());
674 674
675 // Success is not crashing. 675 // Success is not crashing.
676 runPendingTasks(); 676 runPendingTasks();
677 } 677 }
678 678
679 class FixedLayoutTestWebViewClient : public FrameTestHelpers::TestWebViewClient { 679 class FixedLayoutTestWebViewClient : public FrameTestHelpers::TestWebViewClient {
680 public: 680 public:
681 virtual WebScreenInfo screenInfo() override { return m_screenInfo; } 681 virtual WebScreenInfo screenInfo() override { return m_screenInfo; }
(...skipping 6200 matching lines...) Expand 10 before | Expand all | Expand 10 after
6882 EXPECT_EQ(1u, frameClient.navigationalDataReceivedCount()); 6882 EXPECT_EQ(1u, frameClient.navigationalDataReceivedCount());
6883 6883
6884 // Neither should a page reload. 6884 // Neither should a page reload.
6885 localFrame->reload(); 6885 localFrame->reload();
6886 EXPECT_EQ(4u, frameClient.provisionalLoadCount()); 6886 EXPECT_EQ(4u, frameClient.provisionalLoadCount());
6887 EXPECT_FALSE(frameClient.wasLastProvisionalLoadATransition()); 6887 EXPECT_FALSE(frameClient.wasLastProvisionalLoadATransition());
6888 EXPECT_EQ(1u, frameClient.navigationalDataReceivedCount()); 6888 EXPECT_EQ(1u, frameClient.navigationalDataReceivedCount());
6889 } 6889 }
6890 6890
6891 } // namespace 6891 } // namespace
OLDNEW
« Source/web/WebLocalFrameImpl.cpp ('K') | « Source/web/WebPagePopupImpl.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698