Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(9222)

Unified Diff: chrome/test/data/webui/mock4js_browsertest.js

Issue 8480027: Revert 109678 - WebUI test framework: fix Mock4JS verification, allow chrome.send passthrough. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/test/data/webui/chrome_send_browsertest-inl.h ('k') | chrome/test/data/webui/test_api.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/data/webui/mock4js_browsertest.js
===================================================================
--- chrome/test/data/webui/mock4js_browsertest.js (revision 109679)
+++ chrome/test/data/webui/mock4js_browsertest.js (working copy)
@@ -1,76 +0,0 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-/**
- * @fileoverview Tests for Mock4JS to ensure that expectations pass or fail as
- * expected using the test framework.
- * @author scr@chromium.org (Sheridan Rawlins)
- * @see test_api.js
- */
-
-/**
- * Test fixture for Mock4JS testing.
- * @constructor
- * @extends {testing.Test}
- */
-function Mock4JSWebUITest() {}
-
-Mock4JSWebUITest.prototype = {
- __proto__: testing.Test.prototype,
-
- /** @inheritDoc */
- browsePreload: DUMMY_URL,
-
- /** @inheritDoc */
- setUp: function() {
- function MockHandler() {}
- MockHandler.prototype = {
- callMe: function() {},
- };
- this.mockHandler = mock(MockHandler);
- },
-};
-
-TEST_F('Mock4JSWebUITest', 'CalledExpectPasses', function() {
- this.mockHandler.expects(once()).callMe();
- this.mockHandler.proxy().callMe();
-});
-
-TEST_F('Mock4JSWebUITest', 'CalledTwiceExpectTwice', function() {
- this.mockHandler.expects(exactly(2)).callMe();
- var proxy = this.mockHandler.proxy();
- proxy.callMe();
- proxy.callMe();
-});
-
-/**
- * Test fixture for Mock4JS testing which is expected to fail.
- * @constructor
- * @extends {Mock4JSWebUITest}
- */
-function Mock4JSWebUITestFails() {}
-
-Mock4JSWebUITestFails.prototype = {
- __proto__: Mock4JSWebUITest.prototype,
-
- /** @inheritDoc */
- testShouldFail: true,
-};
-
-TEST_F('Mock4JSWebUITestFails', 'NotCalledExpectFails', function() {
- this.mockHandler.expects(once()).callMe();
-});
-
-TEST_F('Mock4JSWebUITestFails', 'CalledTwiceExpectOnceFails', function() {
- this.mockHandler.expects(once()).callMe();
- var proxy = this.mockHandler.proxy();
- proxy.callMe();
- proxy.callMe();
-});
-
-TEST_F('Mock4JSWebUITestFails', 'CalledOnceExpectTwiceFails', function() {
- this.mockHandler.expects(exactly(2)).callMe();
- var proxy = this.mockHandler.proxy();
- proxy.callMe();
-});
« no previous file with comments | « chrome/test/data/webui/chrome_send_browsertest-inl.h ('k') | chrome/test/data/webui/test_api.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698