1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
7 * Mock implementation of remoting.ModalDialogFactory for testing.
10 /** @suppress {duplicate} */
11 var remoting = remoting || {};
19 * @extends {remoting.InputDialog}
21 remoting.MockInputDialog = function() {};
24 remoting.MockInputDialog.prototype.show = function() {};
28 * @extends {remoting.MessageDialog}
30 remoting.MockMessageDialog = function() {};
33 remoting.MockMessageDialog.prototype.show = function() {};
37 * @extends {remoting.Html5ModalDialog}
39 remoting.MockHtml5ModalDialog = function() {};
42 remoting.MockHtml5ModalDialog.prototype.show = function() {};
46 * @extends {remoting.ConnectingDialog}
48 remoting.MockConnectingDialog = function() {};
51 remoting.MockConnectingDialog.prototype.show = function() {};
54 remoting.MockConnectingDialog.prototype.hide = function() {};
58 * @extends {remoting.ModalDialogFactory}
60 remoting.MockModalDialogFactory = function() {
61 /** @type {remoting.MockConnectingDialog} */
62 this.connectingDialog = new remoting.MockConnectingDialog();
63 /** @type {remoting.MockMessageDialog} */
64 this.messageDialog = new remoting.MockMessageDialog();
65 /** @type {remoting.MockInputDialog} */
66 this.inputDialog = new remoting.MockInputDialog();
67 /** @type {remoting.MockHtml5ModalDialog} */
68 this.html5ModalDialog = new remoting.MockHtml5ModalDialog();
72 remoting.MockModalDialogFactory.prototype.createConnectingDialog =
73 function(cancelCallback) {
74 return this.connectingDialog;
78 remoting.MockModalDialogFactory.prototype.createHtml5ModalDialog =
80 return this.html5ModalDialog;
84 remoting.MockModalDialogFactory.prototype.createMessageDialog =
85 function(mode, primaryButton, opt_secondaryButton) {
86 return this.messageDialog;
90 remoting.MockModalDialogFactory.prototype.createInputDialog =
91 function(mode, formElement, inputField, cancelButton) {
92 return this.inputDialog;