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

Side by Side Diff: chrome/test/data/webui/test_api.js

Issue 24924002: Switching getting/dismissing cards to new protocol (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Typo Created 7 years, 2 months 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 Library providing basic test framework functionality. 6 * @fileoverview Library providing basic test framework functionality.
7 */ 7 */
8 8
9 /** 9 /**
10 * Namespace for |Test|. 10 * Namespace for |Test|.
(...skipping 714 matching lines...) Expand 10 before | Expand all | Expand 10 after
725 * @return {String} Call signature. 725 * @return {String} Call signature.
726 * @private 726 * @private
727 */ 727 */
728 getCall_: function(caller) { 728 getCall_: function(caller) {
729 var stackInfo = this.getCallerInfo_(caller); 729 var stackInfo = this.getCallerInfo_(caller);
730 var count = 730 var count =
731 this.counts_[stackInfo.callerCallerString][stackInfo.callerName]; 731 this.counts_[stackInfo.callerCallerString][stackInfo.callerName];
732 732
733 // Allow pattern to match multiple lines for text wrapping. 733 // Allow pattern to match multiple lines for text wrapping.
734 var callerRegExp = 734 var callerRegExp =
735 new RegExp(stackInfo.callerName + '\\((.|\\n)*?\\);', 'g'); 735 new RegExp(stackInfo.callerName + '\\((.|\\n|\\r)*?\\);', 'g');
robliao 2013/09/27 19:41:55 Windows is sending \r's?
vadimt 2013/09/27 21:06:00 Yep.
736 736
737 // Find all matches allowing wrap around such as when a helper function 737 // Find all matches allowing wrap around such as when a helper function
738 // calls assert/expect calls and that helper function is called multiple 738 // calls assert/expect calls and that helper function is called multiple
739 // times. 739 // times.
740 var matches = stackInfo.callerCallerString.match(callerRegExp); 740 var matches = stackInfo.callerCallerString.match(callerRegExp);
741 var match = matches[(count - 1) % matches.length]; 741 var match = matches[(count - 1) % matches.length];
742 742
743 // Chop off the trailing ';'. 743 // Chop off the trailing ';'.
744 return match.substring(0, match.length-1); 744 return match.substring(0, match.length-1);
745 }, 745 },
(...skipping 1010 matching lines...) Expand 10 before | Expand all | Expand 10 after
1756 exports.TEST = TEST; 1756 exports.TEST = TEST;
1757 exports.TEST_F = TEST_F; 1757 exports.TEST_F = TEST_F;
1758 exports.RUNTIME_TEST_F = TEST_F; 1758 exports.RUNTIME_TEST_F = TEST_F;
1759 exports.GEN = GEN; 1759 exports.GEN = GEN;
1760 exports.GEN_INCLUDE = GEN_INCLUDE; 1760 exports.GEN_INCLUDE = GEN_INCLUDE;
1761 exports.WhenTestDone = WhenTestDone; 1761 exports.WhenTestDone = WhenTestDone;
1762 1762
1763 // Import the Mock4JS helpers. 1763 // Import the Mock4JS helpers.
1764 Mock4JS.addMockSupport(exports); 1764 Mock4JS.addMockSupport(exports);
1765 })(this); 1765 })(this);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698