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

Unified Diff: chrome/test/data/extensions/api_test/activity_log_private/test/test.js

Issue 2962093002: [Extensions Bindings] Add activity logging of custom handling (Closed)
Patch Set: . Created 3 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: chrome/test/data/extensions/api_test/activity_log_private/test/test.js
diff --git a/chrome/test/data/extensions/api_test/activity_log_private/test/test.js b/chrome/test/data/extensions/api_test/activity_log_private/test/test.js
index fb726a489b9b21ed33317038d2a37c48ee41c368..df6b1b08381a53d5c9b30a757169109d4b4cff0f 100644
--- a/chrome/test/data/extensions/api_test/activity_log_private/test/test.js
+++ b/chrome/test/data/extensions/api_test/activity_log_private/test/test.js
@@ -39,9 +39,11 @@ testCases.push({
'app_bindings', function response() { });
},
expected_activity: [
- 'app.GetDetails',
- 'app.GetIsInstalled',
- 'app.getInstallState'
+ // These API calls show up differently depending on whether native bindings
+ // are enabled.
+ /app\.[gG]etDetails/,
+ /app\.[gG]etIsInstalled/,
+ /app\.(getI|i)nstallState/,
]
});
testCases.push({
@@ -481,8 +483,11 @@ chrome.activityLogPrivate.onExtensionActivity.addListener(
if (callIndx > -1) {
expectedCall = testCase.expected_activity[callIndx];
}
- console.log('Logged:' + apiCall + ' Expected:' + expectedCall);
- chrome.test.assertEq(expectedCall, apiCall);
+ // Allow either a RegExp or a strict string comparison.
+ if (expectedCall instanceof RegExp)
+ chrome.test.assertTrue(expectedCall.test(apiCall));
+ else
+ chrome.test.assertEq(expectedCall, apiCall);
// Check that no real URLs are logged in incognito-mode tests. Ignore
// the initial call to windows.create opening the tab.

Powered by Google App Engine
This is Rietveld 408576698