Roll src/third_party/WebKit 3529d49:06e8485 (svn 202554:202555)
[chromium-blink-merge.git] / remoting / webapp / crd / js / mock_modal_dialog_factory.js
blob2c89c6a765f742f29ab3252fce8d271532c393f2
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.
5 /**
6  * @fileoverview
7  * Mock implementation of remoting.ModalDialogFactory for testing.
8  */
10 /** @suppress {duplicate} */
11 var remoting = remoting || {};
13 (function() {
15 'use strict';
17 /**
18  * @constructor
19  * @extends {remoting.InputDialog}
20  */
21 remoting.MockInputDialog = function() {};
23 /** @override */
24 remoting.MockInputDialog.prototype.show = function() {};
26 /**
27  * @constructor
28  * @extends {remoting.MessageDialog}
29  */
30 remoting.MockMessageDialog = function() {};
32 /** @override */
33 remoting.MockMessageDialog.prototype.show = function() {};
35 /**
36  * @constructor
37  * @extends {remoting.Html5ModalDialog}
38  */
39 remoting.MockHtml5ModalDialog = function() {};
41 /** @override */
42 remoting.MockHtml5ModalDialog.prototype.show = function() {};
44 /**
45  * @constructor
46  * @extends {remoting.ConnectingDialog}
47  */
48 remoting.MockConnectingDialog = function() {};
50 /** @override */
51 remoting.MockConnectingDialog.prototype.show = function() {};
53 /** @override */
54 remoting.MockConnectingDialog.prototype.hide = function() {};
56 /**
57  * @constructor
58  * @extends {remoting.ModalDialogFactory}
59  */
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();
71 /** @override */
72 remoting.MockModalDialogFactory.prototype.createConnectingDialog =
73     function(cancelCallback) {
74   return this.connectingDialog;
77 /** @override */
78 remoting.MockModalDialogFactory.prototype.createHtml5ModalDialog =
79     function(params) {
80   return this.html5ModalDialog;
83 /** @override */
84 remoting.MockModalDialogFactory.prototype.createMessageDialog =
85     function(mode, primaryButton, opt_secondaryButton) {
86   return this.messageDialog;
89 /** @override */
90 remoting.MockModalDialogFactory.prototype.createInputDialog =
91     function(mode, formElement, inputField, cancelButton) {
92   return this.inputDialog;
95 })();