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

Side by Side Diff: content/public/android/javatests/src/org/chromium/content/browser/PostMessageTest.java

Issue 572013002: Removing ContentViewCore dependencies from direct WebContents functions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased the patch and addressed review comments. Created 6 years, 2 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 package org.chromium.content.browser; 5 package org.chromium.content.browser;
6 6
7 import android.test.suitebuilder.annotation.SmallTest; 7 import android.test.suitebuilder.annotation.SmallTest;
8 8
9 import org.chromium.base.test.util.Feature; 9 import org.chromium.base.test.util.Feature;
10 10
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 protected void setUp() throws Exception { 65 protected void setUp() throws Exception {
66 super.setUp(); 66 super.setUp();
67 mMessageObject = new MessageObject(); 67 mMessageObject = new MessageObject();
68 setUpContentView(mMessageObject, "messageObject"); 68 setUpContentView(mMessageObject, "messageObject");
69 } 69 }
70 70
71 @SmallTest 71 @SmallTest
72 @Feature({"AndroidWebView", "Android-PostMessage"}) 72 @Feature({"AndroidWebView", "Android-PostMessage"})
73 public void testPostMessageToMainFrame() throws Throwable { 73 public void testPostMessageToMainFrame() throws Throwable {
74 ContentViewCore contentViewCore = getContentViewCore(); 74 ContentViewCore contentViewCore = getContentViewCore();
75 loadDataSync(contentViewCore, URL1, "text/html", false); 75 loadDataSync(contentViewCore.getWebContents().getNavigationController(), URL1, "text/html",
76 false);
76 contentViewCore.postMessageToFrame(null, MESSAGE, SOURCE_ORIGIN, "*"); 77 contentViewCore.postMessageToFrame(null, MESSAGE, SOURCE_ORIGIN, "*");
77 mMessageObject.waitForMessage(); 78 mMessageObject.waitForMessage();
78 assertEquals(MESSAGE, mMessageObject.getData()); 79 assertEquals(MESSAGE, mMessageObject.getData());
79 assertEquals(SOURCE_ORIGIN, mMessageObject.getOrigin()); 80 assertEquals(SOURCE_ORIGIN, mMessageObject.getOrigin());
80 } 81 }
81 } 82 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698