| 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 405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 416 final AwContentsClient awContentsClient, boolean supportsLegacyQuirk
s) { | 416 final AwContentsClient awContentsClient, boolean supportsLegacyQuirk
s) { |
| 417 final TestDependencyFactory testDependencyFactory = createTestDependency
Factory(); | 417 final TestDependencyFactory testDependencyFactory = createTestDependency
Factory(); |
| 418 | 418 |
| 419 boolean allowHardwareAcceleration = isHardwareAcceleratedTest(); | 419 boolean allowHardwareAcceleration = isHardwareAcceleratedTest(); |
| 420 final AwTestContainerView testContainerView = | 420 final AwTestContainerView testContainerView = |
| 421 testDependencyFactory.createAwTestContainerView(getActivity(), | 421 testDependencyFactory.createAwTestContainerView(getActivity(), |
| 422 allowHardwareAcceleration); | 422 allowHardwareAcceleration); |
| 423 | 423 |
| 424 AwSettings awSettings = testDependencyFactory.createAwSettings(getActivi
ty(), | 424 AwSettings awSettings = testDependencyFactory.createAwSettings(getActivi
ty(), |
| 425 supportsLegacyQuirks); | 425 supportsLegacyQuirks); |
| 426 testContainerView.initialize(new AwContents( | 426 testContainerView.initialize(new AwContents(mBrowserContext, testContain
erView, |
| 427 mBrowserContext, testContainerView, testContainerView.getContext
(), | 427 testContainerView.getContext(), testContainerView.getInternalAcc
essDelegate(), |
| 428 testContainerView.getInternalAccessDelegate(), | 428 testContainerView.getNativeDrawGLFunctorFactory(), awContentsCli
ent, awSettings, |
| 429 testContainerView.getNativeGLDelegate(), awContentsClient, | 429 testDependencyFactory)); |
| 430 awSettings, testDependencyFactory)); | |
| 431 return testContainerView; | 430 return testContainerView; |
| 432 } | 431 } |
| 433 | 432 |
| 434 protected boolean isHardwareAcceleratedTest() { | 433 protected boolean isHardwareAcceleratedTest() { |
| 435 return !testMethodHasAnnotation(DisableHardwareAccelerationForTest.class
); | 434 return !testMethodHasAnnotation(DisableHardwareAccelerationForTest.class
); |
| 436 } | 435 } |
| 437 | 436 |
| 438 public AwTestContainerView createAwTestContainerViewOnMainSync( | 437 public AwTestContainerView createAwTestContainerViewOnMainSync( |
| 439 final AwContentsClient client) throws Exception { | 438 final AwContentsClient client) throws Exception { |
| 440 return createAwTestContainerViewOnMainSync(client, false); | 439 return createAwTestContainerViewOnMainSync(client, false); |
| (...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 652 } | 651 } |
| 653 }); | 652 }); |
| 654 | 653 |
| 655 OnPageFinishedHelper onPageFinishedHelper = popupContentsClient.getOnPag
eFinishedHelper(); | 654 OnPageFinishedHelper onPageFinishedHelper = popupContentsClient.getOnPag
eFinishedHelper(); |
| 656 int callCount = onPageFinishedHelper.getCallCount(); | 655 int callCount = onPageFinishedHelper.getCallCount(); |
| 657 onPageFinishedHelper.waitForCallback(callCount, 1, WAIT_TIMEOUT_MS, Time
Unit.MILLISECONDS); | 656 onPageFinishedHelper.waitForCallback(callCount, 1, WAIT_TIMEOUT_MS, Time
Unit.MILLISECONDS); |
| 658 | 657 |
| 659 return new PopupInfo(popupContentsClient, popupContainerView, popupConte
nts); | 658 return new PopupInfo(popupContentsClient, popupContainerView, popupConte
nts); |
| 660 } | 659 } |
| 661 } | 660 } |
| OLD | NEW |