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

Unified Diff: chrome/android/javatests/src/org/chromium/chrome/browser/printing/PrintingControllerTest.java

Issue 184343013: Add a method to query whether printing is active. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: addressed code review Created 6 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: chrome/android/javatests/src/org/chromium/chrome/browser/printing/PrintingControllerTest.java
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/printing/PrintingControllerTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/printing/PrintingControllerTest.java
index 1355051ba31e41116e49ae40d60d4b33d168d3ec..8d730ce3f6a1b196da72e71ea52f180694814f47 100644
--- a/chrome/android/javatests/src/org/chromium/chrome/browser/printing/PrintingControllerTest.java
+++ b/chrome/android/javatests/src/org/chromium/chrome/browser/printing/PrintingControllerTest.java
@@ -142,21 +142,11 @@ public class PrintingControllerTest extends ChromeShellTestBase {
private PrintingControllerImpl createControllerOnUiThread() {
try {
- final PrintManagerDelegate mockPrintManagerDelegate = new PrintManagerDelegate() {
- @Override
- public void print(String printJobName,
- PrintDocumentAdapter documentAdapter,
- PrintAttributes attributes) {
- // Do nothing, as we will emulate the framework call sequence within the test.
- }
- };
-
final FutureTask<PrintingControllerImpl> task =
new FutureTask<PrintingControllerImpl>(new Callable<PrintingControllerImpl>() {
@Override
public PrintingControllerImpl call() throws Exception {
return (PrintingControllerImpl) PrintingControllerImpl.create(
- mockPrintManagerDelegate,
new PrintDocumentAdapterWrapper(),
PRINT_JOB_NAME);
}
@@ -174,10 +164,19 @@ public class PrintingControllerTest extends ChromeShellTestBase {
private void startControllerOnUiThread(final PrintingControllerImpl controller,
final TestShellTab tab) {
try {
+ final PrintManagerDelegate mockPrintManagerDelegate = new PrintManagerDelegate() {
+ @Override
+ public void print(String printJobName,
+ PrintDocumentAdapter documentAdapter,
+ PrintAttributes attributes) {
+ // Do nothing, as we will emulate the framework call sequence within the test.
+ }
+ };
+
runTestOnUiThread(new Runnable() {
@Override
public void run() {
- controller.startPrint(new TabPrinter(tab));
+ controller.startPrint(new TabPrinter(tab), mockPrintManagerDelegate);
}
});
} catch (Throwable e) {

Powered by Google App Engine
This is Rietveld 408576698