OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 /** | 5 /** |
6 * @fileoverview | 6 * @fileoverview |
7 * @suppress {checkTypes} | 7 * @suppress {checkTypes} |
8 * Browser test for the scenario below: | 8 * Browser test for the scenario below: |
9 * 1. Enter full-screen mode | 9 * 1. Enter full-screen mode |
10 * 2. Move the mouse to each edge; verify that the desktop bump-scrolls. | 10 * 2. Move the mouse to each edge; verify that the desktop bump-scrolls. |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 return this.bumpScroller_; | 51 return this.bumpScroller_; |
52 }; | 52 }; |
53 | 53 |
54 browserTest.FakeDesktopViewport.prototype.raiseEvent = | 54 browserTest.FakeDesktopViewport.prototype.raiseEvent = |
55 function() { | 55 function() { |
56 return this.bumpScroller_.raiseEvent.apply(this.bumpScroller_, arguments); | 56 return this.bumpScroller_.raiseEvent.apply(this.bumpScroller_, arguments); |
57 }; | 57 }; |
58 | 58 |
59 /** @return {remoting.DesktopViewport} */ | 59 /** @return {remoting.DesktopViewport} */ |
60 function getViewportForTesting() { | 60 function getViewportForTesting() { |
61 var view = remoting.desktopDelegateForTesting.getConnectedViewForTesting(); | 61 var desktopApp = /** @type {remoting.DesktopRemoting} */ (remoting.app); |
| 62 var view = desktopApp.getConnectedViewForTesting(); |
62 if (view) { | 63 if (view) { |
63 return view.getViewportForTesting(); | 64 return view.getViewportForTesting(); |
64 } | 65 } |
65 return null; | 66 return null; |
66 } | 67 } |
67 | 68 |
68 /** @constructor */ | 69 /** @constructor */ |
69 browserTest.Bump_Scroll = function() { | 70 browserTest.Bump_Scroll = function() { |
70 // To avoid dependencies on the actual host desktop size, we simulate a | 71 // To avoid dependencies on the actual host desktop size, we simulate a |
71 // desktop larger or smaller than the client window. The exact value is | 72 // desktop larger or smaller than the client window. The exact value is |
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
336 * occurs within a timeout. | 337 * occurs within a timeout. |
337 */ | 338 */ |
338 browserTest.Bump_Scroll.prototype.verifyNoScroll = | 339 browserTest.Bump_Scroll.prototype.verifyNoScroll = |
339 function(opt_desktopViewport) { | 340 function(opt_desktopViewport) { |
340 var desktopViewport = opt_desktopViewport || getViewportForTesting(); | 341 var desktopViewport = opt_desktopViewport || getViewportForTesting(); |
341 var bumpScroller = desktopViewport.getBumpScrollerForTesting(); | 342 var bumpScroller = desktopViewport.getBumpScrollerForTesting(); |
342 if (!bumpScroller) { | 343 if (!bumpScroller) { |
343 Promise.resolve(true); | 344 Promise.resolve(true); |
344 } | 345 } |
345 return this.verifyScroll(undefined, undefined, desktopViewport); | 346 return this.verifyScroll(undefined, undefined, desktopViewport); |
346 }; | 347 }; |
OLD | NEW |