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

Unified Diff: chrome/test/data/webui/settings/cups_printer_page_tests.js

Issue 2915703002: Query printers for autoconf info during setup. (Closed)
Patch Set: fix test Created 3 years, 6 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
« no previous file with comments | « chrome/browser/ui/webui/settings/chromeos/cups_printers_handler.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/data/webui/settings/cups_printer_page_tests.js
diff --git a/chrome/test/data/webui/settings/cups_printer_page_tests.js b/chrome/test/data/webui/settings/cups_printer_page_tests.js
index 715fd44fa465117e50b0d3c352ad50551b636e4a..aa5d17554b746969ab734844f65162ed2eca9c0d 100644
--- a/chrome/test/data/webui/settings/cups_printer_page_tests.js
+++ b/chrome/test/data/webui/settings/cups_printer_page_tests.js
@@ -12,6 +12,7 @@ var TestCupsPrintersBrowserProxy = function() {
'getCupsPrintersList',
'getCupsPrinterManufacturersList',
'getCupsPrinterModelsList',
+ 'getPrinterInfo',
'startDiscoveringPrinters',
'stopDiscoveringPrinters',
]);
@@ -23,6 +24,7 @@ TestCupsPrintersBrowserProxy.prototype = {
printerList: [],
manufacturers: [],
models: [],
+ printerInfo: {},
/** @override */
getCupsPrintersList: function() {
@@ -42,6 +44,13 @@ TestCupsPrintersBrowserProxy.prototype = {
return Promise.resolve(this.models);
},
+ /** @override */
+ getPrinterInfo: function(newPrinter) {
+ this.methodCalled('getPrinterInfo', newPrinter);
+ // Reject all calls for now.
+ return Promise.reject();
+ },
+
/** @override */
startDiscoveringPrinters: function() {
this.methodCalled('startDiscoveringPrinters');
@@ -117,15 +126,20 @@ suite('CupsAddPrinterDialogTests', function() {
// Now we should be in the manually add dialog.
var addDialog = dialog.$$('add-printer-manually-dialog');
assertTrue(!!addDialog);
-
fillAddManuallyDialog(addDialog);
MockInteractions.tap(addDialog.$$('.action-button'));
Polymer.dom.flush();
-
- // showing model selection
- assertFalse(!!dialog.$$('add-printer-configuring-dialog'));
- assertTrue(!!dialog.$$('add-printer-manufacturer-model-dialog'));
+ // Configure is shown until getPrinterInfo is rejected.
+ assertTrue(!!dialog.$$('add-printer-configuring-dialog'));
+
+ // Upon rejection, show model.
+ return cupsPrintersBrowserProxy.
+ whenCalled('getCupsPrinterManufacturersList').
+ then(function() {
+ // TODO(skau): Verify other dialogs are hidden.
+ assertTrue(!!dialog.$$('add-printer-manufacturer-model-dialog'));
+ });
});
/**
@@ -149,10 +163,11 @@ suite('CupsAddPrinterDialogTests', function() {
MockInteractions.tap(addDialog.$$('.action-button'));
Polymer.dom.flush();
- var modelDialog = dialog.$$('add-printer-manufacturer-model-dialog');
- assertTrue(!!modelDialog);
-
- return cupsPrintersBrowserProxy.whenCalled(
- 'getCupsPrinterManufacturersList');
+ return cupsPrintersBrowserProxy.
+ whenCalled('getCupsPrinterManufacturersList').
+ then(function() {
+ var modelDialog = dialog.$$('add-printer-manufacturer-model-dialog');
+ assertTrue(!!modelDialog);
+ });
});
});
« no previous file with comments | « chrome/browser/ui/webui/settings/chromeos/cups_printers_handler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698