summaryrefslogtreecommitdiffstats
path: root/remoting/webapp/unittests
Commit message (Collapse)AuthorAgeFilesLines
* Make pop-up menus more easily dismissable.jamiewalch2014-09-251-8/+9
| | | | | | | | | | | | | | | | | Previously, menus were dismissed by adding a click handler to the <body>, but that doesn't intercept clicks on the plugin element and complicates the logic somewhat because a second click on the button while the menu is visible then triggers both the show and hide handlers by default. This CL adds an explicit <div> covering the entire window, but behind the menu in the z-order. This <div> doesn't prevent window dragging, despite being on top of the title-bar, so I've also made that conditional on there being no menu visible. BUG=416307 Review URL: https://codereview.chromium.org/592793003 Cr-Commit-Position: refs/heads/master@{#296631}
* Fix MenuButton for the case where multiple listeners are defined.jamiewalch2014-09-191-0/+3
| | | | | | | | | | | | | | | | | | | This is a minimal fix suitable for merging to M38. The underlying problem is that we create a new MenuButton instance (with its own click handler) for every connection. I recently changed the behaviour of MenuButton so that it toggles the 'active' class instead of adding it so that clicking on the button while a menu is open will dismiss it. However, this breaks if there an even number of MenuButton instances for a single DOM element. The correct fix is to make the tool-bar buttons owned by the tool-bar, which is a singleton. However, this minimal fix, which restores the M37 behaviour, is a better option for merging to M38. BUG=415410 Review URL: https://codereview.chromium.org/584693003 Cr-Commit-Position: refs/heads/master@{#295759}
* Reduce number of roundtrips required in XMPP handshakesergeyu2014-09-051-45/+49
| | | | | | | | | | | | | | Previously XMPP handshake implemented in XmppLoginHandler required 7 roundtrips (excluding TLS handshake). With this change it will be sending each message as soon as possible without waiting response to the previous message. This effectivelly reduces number of required roundtrips to 3. BUG=274652 Review URL: https://codereview.chromium.org/534853002 Cr-Commit-Position: refs/heads/master@{#293389}
* Use XMPP in V2 webappsergeyu2014-09-041-5/+6
| | | | | | | | | | | After this change the webapp will be use XMPP for signaling instead of WCS. BUG=274652 Review URL: https://codereview.chromium.org/530213004 Cr-Commit-Position: refs/heads/master@{#293273}
* Hangouts Remote Desktop Part VI - Show confirm dialog before retrieving ↵kelvinp2014-09-032-8/+17
| | | | | | | | | | | | | | | | | | access code This dialog explains the implications of accepting remote assistance and provides a way for the user to decline assistance. This ensures that even if the caller (Hangouts) is compromised, it won't be able to control the user's desktop without user interaction. BUG=405139 Review URL: https://codereview.chromium.org/503063004 Cr-Commit-Position: refs/heads/master@{#293200}
* XMPP implementation in JavaScript.sergeyu2014-09-034-0/+365
| | | | | | | | | | | | This adds XMPP implementation that will be used for signaling in the webapp instead of WCS. It depends on TLS support added in the TCP API in Chrome 38. BUG=274652 Review URL: https://codereview.chromium.org/514343002 Cr-Commit-Position: refs/heads/master@{#293068}
* Hangouts Remote Desktop Part V - It2MeHelpeeChannelkelvinp@chromium.org2014-08-211-0/+164
| | | | | | | | | | | | | | | | | | | | This CL introduces the class, which relays messages between the Hangouts web page (Hangouts) and the It2Me Native Messaging Host (It2MeHost) for the helpee (The hangout participant who is receiving remoting assistance). It runs in the background page. It contains a chrome.runtime.Port object, representing a connection to Hangouts and a remoting.It2MeHostFacade object, representing a connection to the IT2Me Native Messaging Host. After this CL, the webapp is ready for integration with Hangouts, with the exception of two outstanding work items below that must be addressed before launching: 1. Fetch the OAuthToken using remoting.OAuth2 for the v1 app (crbug.com/405130). 2. Show the confirm dialog using chrome.app.AppWindow for the v2 app (crbug.com/405139). Review URL: https://codereview.chromium.org/484353002 Cr-Commit-Position: refs/heads/master@{#291011} git-svn-id: svn://svn.chromium.org/chrome/trunk/src@291011 0039d316-1c4b-4281-b951-d872f2087c98
* Base.deferredkelvinp@chromium.org2014-08-191-0/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Promise is a great tool for writing asynchronous code. However, the construct var p = new promise(function init(resolve, reject) { ... // code that fulfills the promise. }); forces the promise resolving logic to reside in the init function of the constructor. This is problematic when you need to resolve the promise in a member function (which is quite common for event callbacks). base.Deferred comes to the rescue. It encapsulates a promise object and exposes member methods (resolve/reject) to fulfill it. Here are the recommended steps to follow when implementing an asynchronous function that returns a promise: 1. Create a deferred object by calling var deferred = new base.Deferred(); 2. Call deferred.resolve() when the asynchronous operation finishes. 3. Call deferred.reject() when the asynchronous operation fails. 4. Returns deferred.promise() to the caller so that it can subscribe to status changes using the |then| handler. Sample Usage: function myAsyncAPI() { var deferred = new base.Deferred(); window.setTimeout(function() { deferred.resolve(); }, 100); return deferred.promise(); }; Review URL: https://codereview.chromium.org/483753004 Cr-Commit-Position: refs/heads/master@{#290460} git-svn-id: svn://svn.chromium.org/chrome/trunk/src@290460 0039d316-1c4b-4281-b951-d872f2087c98
* Move hello message from It2MeService to It2MeChannelkelvinp@chromium.org2014-08-162-13/+10
| | | | | | | | | | | | Currently, Hangouts sends a hello message to the webapp before establishing a long-lived connection. After this CL, Hangouts will establish the connection first and then send a hello message. If the webapp is not installed, Hangouts will receive a disconnect event on the port. If the webapp is installed, Hangouts will receive a hello response with the list of supported features. Review URL: https://codereview.chromium.org/473073002 Cr-Commit-Position: refs/heads/master@{#290127} git-svn-id: svn://svn.chromium.org/chrome/trunk/src@290127 0039d316-1c4b-4281-b951-d872f2087c98
* Hangouts remote desktop part III - It2MeServicekelvinp@chromium.org2014-08-143-0/+374
| | | | | | | | | | | This CL - Introduces an It2MeService component that listens to incoming connection requests between Hangouts and the webapp and establish a channel between them. - It enables launching an IT2Me helper session from Hangouts Review URL: https://codereview.chromium.org/468693002 Cr-Commit-Position: refs/heads/master@{#289538} git-svn-id: svn://svn.chromium.org/chrome/trunk/src@289538 0039d316-1c4b-4281-b951-d872f2087c98
* Hangout remote desktop part II - background.html and AppLauncherkelvinp@chromium.org2014-08-121-0/+19
| | | | | | | | | | | | | | This CL: - Moves background.js to background.html - Introduces remoting.appLauncher that allows the caller to launch and close the webapp without knowing the implementation difference between a v1 app and a v2 app. NOTRY=true R=jamiewalch@chromium.org Review URL: https://codereview.chromium.org/450383003 Cr-Commit-Position: refs/heads/master@{#289096} git-svn-id: svn://svn.chromium.org/chrome/trunk/src@289096 0039d316-1c4b-4281-b951-d872f2087c98
* Add Promise.negate.jamiewalch@chromium.org2014-07-311-0/+14
| | | | | | Review URL: https://codereview.chromium.org/424273002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@286741 0039d316-1c4b-4281-b951-d872f2087c98
* Remove the blue tool-bar for apps v2.jamiewalch@chromium.org2014-07-241-6/+14
| | | | | | | | | | | | | | | Its visual style is not really in keeping with the rest of the v2 app, and the form-factor is not conducive to an easily extensible UI. For now, a menu will suffice; if we need anything more complex, it can easily be replaced with an options dialog. This CL also simplifies the MenuButton class to use stopPropagation instead of timers to prevent the close handler being triggered by the same click that opens the menu. BUG=134213 Review URL: https://codereview.chromium.org/339613003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@285136 0039d316-1c4b-4281-b951-d872f2087c98
* Add unit test for l10n.jskelvinp@chromium.org2014-07-231-0/+105
| | | | | | Review URL: https://codereview.chromium.org/399273003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@284959 0039d316-1c4b-4281-b951-d872f2087c98
* Add unit-tests for MenuButton and simplify implementation.jamiewalch@chromium.org2014-07-191-0/+78
| | | | | | | | | | The old method of using a timer to set the closeHandler was messy and harder to unit-test. The new method uses stopPropagation, which is cleaner and makes the unit-tests simpler. Review URL: https://codereview.chromium.org/401623004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@284295 0039d316-1c4b-4281-b951-d872f2087c98
* Fix base_unittest.jskelvinp@chromium.org2014-07-182-105/+170
| | | | | | | | | | | This CL addresses some feedback from Jamie regarding unit test naming conventions and organizations. 1. Renames test_eventSource.js to base_unittest.js. 2. Groups the modules by class instead of by function. 3. Adds extra test cases for base.js Review URL: https://codereview.chromium.org/403663002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@284252 0039d316-1c4b-4281-b951-d872f2087c98
* JavaScript unit test framework - Part II kelvinp@chromium.org2014-07-081-2/+0
| | | | | | | | | | | | | | | | | | | | This change enables running the JavaScript unit test on try bots and build bots using the browser test infrastructure. To run a QUnit test suite as a browser test. 1. include third_party/qunit/src/browser_test_harness.js in your qunit test suite. 2. Derive your browser test from QUnitBrowserTestRunner, and call RunTest with the URL of the test suite. 3. modify chrome_tests.gypi to add the c++ source of your browser test and add your test suite as a run time dependency of the browser_tests executable Summary of changes: 1. QUnit_browser_test_runner.h serves as a base class for a QUnit browser test. It navigates the browser to the QUnit test suite, calls browserTestHarness.run() and listens for the test results. 2. browser_test_harness.js serves as a test took on the QUnit test suite. Using the window.domAutomationController, browser_test_harness.js detects whether it is running under the browser test infrastructure to auto-enable itself and report results back to the browser test. 3. Updates browser_tests.isolate so that the test can run in an isolated test environment. See http://www.chromium.org/developers/testing/isolated-testing. Review URL: https://codereview.chromium.org/376803005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@281872 0039d316-1c4b-4281-b951-d872f2087c98
* Revert of JavaScript unit test framework for Chrome remote desktop - Part II ↵jyasskin@chromium.org2014-07-051-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (https://codereview.chromium.org/351933003/) Reason for revert: Appears to have broken http://build.chromium.org/p/chromium.linux/builders/Linux%20Tests/builds/12029/steps/browser_tests/logs/stdio "isolate" in the error message is suspicious: http://www.chromium.org/developers/testing/isolated-testing [ RUN ] QUnitBrowserTestRunner.Remoting_Webapp_Js_Unittest Xlib: extension "RANDR" missing on display ":9". Xlib: extension "RANDR" missing on display ":9". [12246:12246:0704/181239:WARNING:password_store_factory.cc(213)] Using basic (unencrypted) store for password storage. See http://code.google.com/p/chromium/wiki/LinuxPasswordStorage for more information about password storage options. ../../chrome/test/remoting/qunit_browser_test_runner.cc:43: Failure Value of: PathExists(file) Actual: false Expected: true Error: The QUnit test suite </mnt/data/b/build/slave/Linux_Tests/isolate-2014-07-043CUE8r/out/Release/remoting/unittests/unittest.html> does not exist. [12246:12310:0704/181239:WARNING:raw_channel_posix.cc(214)] recvmsg: Connection reset by peer [ FAILED ] QUnitBrowserTestRunner.Remoting_Webapp_Js_Unittest, where TypeParam = and GetParam() = (329 ms) Original issue's description: > JavaScript unit test framework - Part II > > This change enables running the JavaScript unit test on try bots using the browser test infrastructure. > > To run a QUnit test suite as a browser test. > 1. include third_party/qunit/src/browser_test_harness.js in your qunit test suite. > 2. Derive your browser test from QUnitBrowserTestRunner, and call RunTest with the URL of the test suite. > 3. modify chrome_tests.gypi to add the c++ source of your browser test and add your test suite as a run time dependency of the browser_tests executable > > Summary of changes: > 1. QUnit_browser_test_runner.h serves as a base class for a QUnit browser test. It navigates the browser to the QUnit test suite, calls browserTestHarness.run() and listens for the test results. > > 2. browser_test_harness.js serves as a test took on the QUnit test suite. Using the window.domAutomationController, browser_test_harness.js detects whether it is running under the browser test infrastructure to auto-enable itself and report results back to the browser test. > > Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=281451 TBR=sergeyu@chromium.org,rmsousa@chromium.org,jamiewalch@chromium.org,anandc@chromium.org,kelvinp@chromium.org NOTREECHECKS=true NOTRY=true Review URL: https://codereview.chromium.org/372563002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@281467 0039d316-1c4b-4281-b951-d872f2087c98
* JavaScript unit test framework - Part IIkelvinp@chromium.org2014-07-051-2/+0
| | | | | | | | | | | | | | | | | | This change enables running the JavaScript unit test on try bots using the browser test infrastructure. To run a QUnit test suite as a browser test. 1. include third_party/qunit/src/browser_test_harness.js in your qunit test suite. 2. Derive your browser test from QUnitBrowserTestRunner, and call RunTest with the URL of the test suite. 3. modify chrome_tests.gypi to add the c++ source of your browser test and add your test suite as a run time dependency of the browser_tests executable Summary of changes: 1. QUnit_browser_test_runner.h serves as a base class for a QUnit browser test. It navigates the browser to the QUnit test suite, calls browserTestHarness.run() and listens for the test results. 2. browser_test_harness.js serves as a test took on the QUnit test suite. Using the window.domAutomationController, browser_test_harness.js detects whether it is running under the browser test infrastructure to auto-enable itself and report results back to the browser test. Review URL: https://codereview.chromium.org/351933003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@281451 0039d316-1c4b-4281-b951-d872f2087c98
* JavaScript unit test framework for Chrome Remote Desktop - Part Ikelvinp@chromium.org2014-06-231-0/+107
This change enables running JavaScript unit testing for Chrome Remote Desktop locally with code coverage. To run the tests: 1. ninja -C out/Debug remoting_webapp_unittest 2. ./remoting/tools/run_webapp_unittest.py There will be a follow up CL - Part II - to enable running the tests on try bots using the browser test harness. Summary of changes: 1. Adds the unittest target in remoting_tests.gypi. 2. Modifies build-html.py to support code-coverage and source exclusion. 3. Adds the unittest page for the chromoting webapps. 4. Adds a sample test case for base.EventSource. 5. Adds run_webapp_unittest.py to run the unit test page with the correct flags. Review URL: https://codereview.chromium.org/345833003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@279176 0039d316-1c4b-4281-b951-d872f2087c98