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

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

Issue 2825153002: Update CUPS settings UI to allow USB printers to be added via discovery. (Closed)
Patch Set: Fixup overlooked test revealed by CQ. Created 3 years, 7 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 eab1f1ab30ba927682b6d20cbdcfdeac4a6f9af3..329dc84dcee223c794cdb3411253cf36a281055d 100644
--- a/chrome/test/data/webui/settings/cups_printer_page_tests.js
+++ b/chrome/test/data/webui/settings/cups_printer_page_tests.js
@@ -11,7 +11,9 @@ var TestCupsPrintersBrowserProxy = function() {
settings.TestBrowserProxy.call(this, [
'getCupsPrintersList',
'getCupsPrinterManufacturersList',
- 'getCupsPrinterModelsList'
+ 'getCupsPrinterModelsList',
+ 'startDiscoveringPrinters',
+ 'stopDiscoveringPrinters',
]);
};
@@ -39,10 +41,20 @@ TestCupsPrintersBrowserProxy.prototype = {
this.methodCalled('getCupsPrinterModelsList', manufacturer);
return Promise.resolve(this.models);
},
+
+ /** @override */
+ startDiscoveringPrinters: function() {
+ this.methodCalled('startDiscoveringPrinters');
+ },
+
+ /** @override */
+ stopDiscoveringPrinters: function() {
+ this.methodCalled('stopDiscoveringPrinters');
+ },
};
suite('CupsAddPrinterDialogTests', function() {
- function fillDialog(addDialog) {
+ function fillAddManuallyDialog(addDialog) {
var name = addDialog.$$('#printerNameInput');
var address = addDialog.$$('#printerAddressInput');
@@ -82,22 +94,31 @@ suite('CupsAddPrinterDialogTests', function() {
});
/**
- * Test that the manual add dialog is showing.
+ * Test that the discovery dialog is showing when a user initially asks
+ * to add a printer.
*/
- test('ManualAddShowing', function() {
+ test('DiscoveryShowing', function() {
assertFalse(!!dialog.$$('add-printer-manufacturer-model-dialog'));
assertFalse(!!dialog.$$('add-printer-configuring-dialog'));
- assertTrue(!!dialog.$$('add-printer-manually-dialog'));
+ assertFalse(!!dialog.$$('add-printer-manually-dialog'));
+ assertTrue(!!dialog.$$('add-printer-discovery-dialog'));
});
/**
* Test that clicking on Add opens the model select page.
*/
test('ValidAddOpensModelSelection', function() {
+ // Starts in discovery dialog, select add manually button.
+ var discoveryDialog = dialog.$$('add-printer-discovery-dialog');
+ assertTrue(!!discoveryDialog);
+ MockInteractions.tap(discoveryDialog.$$('.secondary-button'));
+ Polymer.dom.flush();
+
+ // Now we should be in the manually add dialog.
var addDialog = dialog.$$('add-printer-manually-dialog');
assertTrue(!!addDialog);
- fillDialog(addDialog);
+ fillAddManuallyDialog(addDialog);
MockInteractions.tap(addDialog.$$('.action-button'));
Polymer.dom.flush();
@@ -111,9 +132,14 @@ suite('CupsAddPrinterDialogTests', function() {
* Test that getModels isn't called with a blank query.
*/
test('NoBlankQueries', function() {
+ var discoveryDialog = dialog.$$('add-printer-discovery-dialog');
+ assertTrue(!!discoveryDialog);
+ MockInteractions.tap(discoveryDialog.$$('.secondary-button'));
+ Polymer.dom.flush();
+
var addDialog = dialog.$$('add-printer-manually-dialog');
assertTrue(!!addDialog);
- fillDialog(addDialog);
+ fillAddManuallyDialog(addDialog);
cupsPrintersBrowserProxy.whenCalled('getCupsPrinterModelsList')
.then(function(manufacturer) { assertGT(0, manufacturer.length); });
« 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