OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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 junit.framework.Assert; | 7 import junit.framework.Assert; |
8 | 8 |
| 9 import org.chromium.content_public.browser.LoadUrlParams; |
| 10 |
9 /** | 11 /** |
10 * Common functionality for testing the Java Bridge. | 12 * Common functionality for testing the Java Bridge. |
11 */ | 13 */ |
12 public class JavaBridgeTestBase extends ContentViewTestBase { | 14 public class JavaBridgeTestBase extends ContentViewTestBase { |
13 protected class Controller { | 15 protected class Controller { |
14 private boolean mIsResultReady; | 16 private boolean mIsResultReady; |
15 | 17 |
16 protected synchronized void notifyResultIsReady() { | 18 protected synchronized void notifyResultIsReady() { |
17 mIsResultReady = true; | 19 mIsResultReady = true; |
18 notify(); | 20 notify(); |
(...skipping 21 matching lines...) Expand all Loading... |
40 // expression evaluated is not 'undefined', this value is | 42 // expression evaluated is not 'undefined', this value is |
41 // converted to a string and used as the new document for the | 43 // converted to a string and used as the new document for the |
42 // frame. We don't want this behaviour, so wrap the script in | 44 // frame. We don't want this behaviour, so wrap the script in |
43 // an anonymous function. | 45 // an anonymous function. |
44 getContentViewCore().loadUrl(new LoadUrlParams( | 46 getContentViewCore().loadUrl(new LoadUrlParams( |
45 "javascript:(function() { " + script + " })()")); | 47 "javascript:(function() { " + script + " })()")); |
46 } | 48 } |
47 }); | 49 }); |
48 } | 50 } |
49 } | 51 } |
OLD | NEW |