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

Unified Diff: chrome/test/data/extensions/activity_log/options.js

Issue 13726026: Added ActivityLog tests and associated bugfixes/extra logging. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Wrapped line Created 7 years, 8 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/activity_log/options.js
diff --git a/chrome/test/data/extensions/activity_log/options.js b/chrome/test/data/extensions/activity_log/options.js
index d7d290d2e5971b3c2e20fac9d323a4b695412a65..1298b303ffc8955c9def15dab8f904dbcc1ee5d3 100644
--- a/chrome/test/data/extensions/activity_log/options.js
+++ b/chrome/test/data/extensions/activity_log/options.js
@@ -68,7 +68,18 @@ function checkNoDoubleLogging() {
setCompleted('checkNoDoubleLogging');
}
+// Check whether we log calls to chrome.app.*;
+function checkAppCalls() {
+ chrome.app.getDetails();
+ setCompleted('chrome.app.getDetails()');
+ var b = chrome.app.isInstalled;
+ setCompleted('chrome.app.isInstalled');
+ var c = chrome.app.installState();
+ setCompleted('chrome.app.installState()');
+}
+
// Makes an API call that the extension doesn't have permission for.
+// Don't add the management permission or this test won't test the code path.
function makeBlockedApiCall() {
try {
var all_extensions = chrome.management.getAll();
@@ -174,6 +185,62 @@ function doWebRequestModifications() {
window.open('http://www.google.co.uk');
}
+function getSetObjectProperties() {
+ chrome.tabs.onUpdated.addListener(
+ function getTabProperties(tabId, changeInfo, tab) {
+ if (changeInfo['status'] === "complete"
+ && tab.url.match(/google\.dk/g)) {
+ console.log(tab.id + " " + tab.index + " " + tab.url);
+ tab.index = 3333333333333333333;
+ chrome.tabs.remove(tabId);
+ chrome.tabs.onUpdated.removeListener(getTabProperties);
+ setCompleted('getSetObjectProperties');
+ }
+ }
+ );
+ window.open('http://www.google.dk');
+}
+
+function callObjectMethod() {
+ var storageArea = chrome.storage.sync;
+ storageArea.clear();
+ setCompleted('callObjectMethod()');
+}
+
+function sendMessageToCS() {
+ chrome.tabs.onUpdated.addListener(
+ function messageCS(tabId, changeInfo, tab) {
+ if (changeInfo['status'] === "complete"
+ && tab.url.match(/google\.com\.bo/g)) {
+ chrome.tabs.sendMessage(tabId, "hellooooo!");
+ chrome.tabs.remove(tabId);
+ chrome.tabs.onUpdated.removeListener(messageCS);
+ setCompleted('sendMessageToCS');
+ }
+ }
+ );
+ window.open('http://www.google.com.bo');
+}
+
+function sendMessageToSelf() {
+ chrome.runtime.sendMessage("hello hello");
+ setCompleted('sendMessageToSelf');
+}
+
+function sendMessageToOther() {
+ chrome.runtime.sendMessage("ocacnieaapoflmkebkeaidpgfngocapl",
+ "knock knock",
+ function response() {
+ console.log("who's there?");
+ });
+ setCompleted('sendMessageToOther');
+}
+
+function connectToOther() {
+ chrome.runtime.connect("ocacnieaapoflmkebkeaidpgfngocapl");
+ setCompleted('connectToOther');
+}
+
// REGISTER YOUR TESTS HERE
// Attach the tests to buttons.
function setupEvents() {
@@ -186,6 +253,13 @@ function setupEvents() {
$('cs_xhr').addEventListener('click', doContentScriptXHR);
$('webrequest').addEventListener('click', doWebRequestModifications);
$('double').addEventListener('click', checkNoDoubleLogging);
+ $('app_bindings').addEventListener('click', checkAppCalls);
+ $('object_properties').addEventListener('click', getSetObjectProperties);
+ $('object_methods').addEventListener('click', callObjectMethod);
+ $('message_cs').addEventListener('click', sendMessageToCS);
+ $('message_self').addEventListener('click', sendMessageToSelf);
+ $('message_other').addEventListener('click', sendMessageToOther);
+ $('connect_other').addEventListener('click', connectToOther);
completed = 0;
total = document.getElementsByTagName('button').length;

Powered by Google App Engine
This is Rietveld 408576698