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.android_webview.test; | 5 package org.chromium.android_webview.test; |
6 | 6 |
7 import android.app.Instrumentation; | 7 import android.app.Instrumentation; |
8 import android.content.Context; | 8 import android.content.Context; |
9 import android.graphics.Bitmap; | 9 import android.graphics.Bitmap; |
10 import android.os.Build; | 10 import android.os.Build; |
(...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
375 * Test cases can provide subclass instances to the createAwTest* methods in
order to create an | 375 * Test cases can provide subclass instances to the createAwTest* methods in
order to create an |
376 * AwContents instance with injected test dependencies. | 376 * AwContents instance with injected test dependencies. |
377 */ | 377 */ |
378 public static class TestDependencyFactory extends AwContents.DependencyFacto
ry { | 378 public static class TestDependencyFactory extends AwContents.DependencyFacto
ry { |
379 public AwTestContainerView createAwTestContainerView(AwTestRunnerActivit
y activity, | 379 public AwTestContainerView createAwTestContainerView(AwTestRunnerActivit
y activity, |
380 boolean allowHardwareAcceleration) { | 380 boolean allowHardwareAcceleration) { |
381 return new AwTestContainerView(activity, allowHardwareAcceleration); | 381 return new AwTestContainerView(activity, allowHardwareAcceleration); |
382 } | 382 } |
383 public AwSettings createAwSettings(Context context, boolean supportsLega
cyQuirks) { | 383 public AwSettings createAwSettings(Context context, boolean supportsLega
cyQuirks) { |
384 return new AwSettings(context, false /* isAccessFromFileURLsGrantedB
yDefault */, | 384 return new AwSettings(context, false /* isAccessFromFileURLsGrantedB
yDefault */, |
385 supportsLegacyQuirks, false /* allowEmptyDocumentPersistence
*/); | 385 supportsLegacyQuirks, false /* allowEmptyDocumentPersistence
*/, |
| 386 true /* allowGeolocationOnInsecureOrigins */); |
386 } | 387 } |
387 } | 388 } |
388 | 389 |
389 protected TestDependencyFactory createTestDependencyFactory() { | 390 protected TestDependencyFactory createTestDependencyFactory() { |
390 return new TestDependencyFactory(); | 391 return new TestDependencyFactory(); |
391 } | 392 } |
392 | 393 |
393 public AwTestContainerView createAwTestContainerView( | 394 public AwTestContainerView createAwTestContainerView( |
394 final AwContentsClient awContentsClient) { | 395 final AwContentsClient awContentsClient) { |
395 return createAwTestContainerView(awContentsClient, false); | 396 return createAwTestContainerView(awContentsClient, false); |
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
653 } | 654 } |
654 }); | 655 }); |
655 | 656 |
656 OnPageFinishedHelper onPageFinishedHelper = popupContentsClient.getOnPag
eFinishedHelper(); | 657 OnPageFinishedHelper onPageFinishedHelper = popupContentsClient.getOnPag
eFinishedHelper(); |
657 int callCount = onPageFinishedHelper.getCallCount(); | 658 int callCount = onPageFinishedHelper.getCallCount(); |
658 onPageFinishedHelper.waitForCallback(callCount, 1, WAIT_TIMEOUT_MS, Time
Unit.MILLISECONDS); | 659 onPageFinishedHelper.waitForCallback(callCount, 1, WAIT_TIMEOUT_MS, Time
Unit.MILLISECONDS); |
659 | 660 |
660 return new PopupInfo(popupContentsClient, popupContainerView, popupConte
nts); | 661 return new PopupInfo(popupContentsClient, popupContainerView, popupConte
nts); |
661 } | 662 } |
662 } | 663 } |
OLD | NEW |