Index: chrome/test/data/extensions/context_menus/incognito/test.js |
diff --git a/chrome/test/data/extensions/context_menus/incognito/test.js b/chrome/test/data/extensions/context_menus/incognito/test.js |
new file mode 100644 |
index 0000000000000000000000000000000000000000..c64b01a36adb066af595813c26981945f84d9274 |
--- /dev/null |
+++ b/chrome/test/data/extensions/context_menus/incognito/test.js |
@@ -0,0 +1,19 @@ |
+// Copyright (c) 2010 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. |
+ |
+var inIncognitoContext = chrome.extension.inIncognitoContext; |
+var incognitoStr = inIncognitoContext ? "incognito" : "regular"; |
+ |
+function onclick(info) { |
+ chrome.test.sendMessage("onclick fired " + incognitoStr); |
+} |
+ |
+window.onload = function() { |
+ chrome.contextMenus.create({title: "item " + incognitoStr, |
+ onclick: onclick}, function() { |
+ if (!chrome.extension.lastError) { |
+ chrome.test.sendMessage("created item " + incognitoStr); |
+ } |
+ }); |
+}; |