Index: chrome/test/data/webui/print_preview.js |
diff --git a/chrome/test/data/webui/print_preview.js b/chrome/test/data/webui/print_preview.js |
index b4f8dacae15e839810f5130c51c7e381d55c7201..2ef9260e87b7a131424bbc96a07c50e7e737dd15 100644 |
--- a/chrome/test/data/webui/print_preview.js |
+++ b/chrome/test/data/webui/print_preview.js |
@@ -70,6 +70,7 @@ PrintPreviewWebUITest.prototype = { |
startGetInitialSettings: function() {}, |
startGetLocalDestinations: function() {}, |
startGetPrivetDestinations: function() {}, |
+ startGetExtensionDestinations: function() {}, |
startGetLocalDestinationCapabilities: function(destinationId) {} |
}; |
var oldNativeLayerEventType = print_preview.NativeLayer.EventType; |
@@ -180,7 +181,7 @@ PrintPreviewWebUITest.prototype = { |
false /*selectionOnly*/, |
'FooDevice' /*systemDefaultDestinationId*/, |
null /*serializedAppStateStr*/, |
- false /*documentHasSelection*/); |
+ null /*serializedDefaultDestinationSelectionRulesStr*/); |
this.localDestinationInfos_ = [ |
{ printerName: 'FooName', deviceName: 'FooDevice' }, |
{ printerName: 'BarName', deviceName: 'BarDevice' } |
@@ -338,6 +339,20 @@ TEST_F('PrintPreviewWebUITest', 'TestPrintPreviewRestoreLocalDestination', |
testDone(); |
}); |
+TEST_F('PrintPreviewWebUITest', |
+ 'TestPrintPreviewDefaultDestinationSelectionRules', function() { |
+ // It also makes sure these rules do override system default destination. |
+ this.initialSettings_.serializedDefaultDestinationSelectionRulesStr_ = |
+ '{"namePattern":".*Bar.*"}'; |
+ this.setInitialSettings(); |
+ this.setLocalDestinations(); |
+ |
+ assertEquals( |
+ 'BarDevice', printPreview.destinationStore_.selectedDestination.id); |
+ |
+ testDone(); |
+}); |
+ |
TEST_F('PrintPreviewWebUITest', 'TestSystemDialogLinkIsHiddenInAppKioskMode', |
function() { |
if (cr.isChromeOS) { |