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

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

Issue 23618010: [Activity log] Expose URL incognito state to private API (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Rebase (against latest) Created 7 years, 3 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
« no previous file with comments | « chrome/browser/extensions/api/activity_log_private/activity_log_private_apitest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 92665a20584caffebea83b4aecea586cfeead52e..db6fa3f16cca4b64ec42cd8ed6a9b90305d2134a 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
@@ -304,6 +304,17 @@ testCases.push({
}
});
+function checkIncognito(url, incognitoExpected) {
+ if (url) {
+ incognitoExpected = Boolean(incognitoExpected);
+ var kIncognitoMarker = '<incognito>';
+ var isIncognito =
+ (url.substr(0, kIncognitoMarker.length) == kIncognitoMarker);
+ chrome.test.assertEq(incognitoExpected, isIncognito,
+ 'Bad incognito state for URL ' + url);
+ }
+}
+
// Listener to check the expected logging is done in the test cases.
var testCaseIndx = 0;
var callIndx = -1;
@@ -322,20 +333,8 @@ chrome.activityLogPrivate.onExtensionActivity.addListener(
chrome.test.assertEq(expectedCall, apiCall);
// Check that no real URLs are logged in incognito-mode tests.
- // TODO(felt): This isn't working correctly. crbug.com/272920
- /*if (activity['activityType'] == 'dom_access') {
- var url = activity['pageUrl'];
- if (url) {
- if (testCases[testCaseIndx].is_incognito) {
- chrome.test.assertEq('<incognito>', url,
- 'URL was not anonymized for apiCall:' +
- apiCall);
- } else {
- chrome.test.assertTrue(url != '<incognito>',
- 'Non-incognito URL was anonymized');
- }
- }
- }*/
+ checkIncognito(activity['pageUrl'], testCases[testCaseIndx].is_incognito);
+ checkIncognito(activity['argUrl'], testCases[testCaseIndx].is_incognito);
// If all the expected calls have been logged for this test case then
// mark as suceeded and move to the next. Otherwise look for the next
« no previous file with comments | « chrome/browser/extensions/api/activity_log_private/activity_log_private_apitest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698