Index: chrome/test/data/extensions/api_test/bindings/override_exports.html |
diff --git a/chrome/test/data/extensions/api_test/bindings/override_exports.html b/chrome/test/data/extensions/api_test/bindings/override_exports.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..c3bec0202f0f4690227a4866cf568c7cd5a3f225 |
--- /dev/null |
+++ b/chrome/test/data/extensions/api_test/bindings/override_exports.html |
@@ -0,0 +1,44 @@ |
+<!doctype html> |
+<html> |
+<body> |
+This is a body |
+<span id="status"></span> |
+</body> |
+<script> |
+var error = ''; |
+var addError = function(newError) { |
+ error += newError; |
+ var status = error.length == 0 ? 'success' : error; |
+ document.getElementById('status').textContent = status; |
+}; |
+ |
+Object.defineProperty(Object.prototype, |
+ 'handleResponse', |
+ {configurable: true, set: function(v) { |
+ addError('Intercepted handleResponse\n'); |
+ Object.defineProperty( |
+ this, "handleResponse", {configurable: true, value: v}); |
+}}); |
+ |
+Object.defineProperty(Object.prototype, |
+ "$set", |
+ {configurable: true, set: function(v) { |
+ addError('Intercepted $set\n'); |
+ Object.defineProperty(this, "$set", {configurable: true, value: v}); |
+}}); |
+ |
+Object.defineProperty(Object.prototype, |
+ "clear", |
+ {configurable: true, set: function(v) { |
+ addError('Intercepted clear\n'); |
+ Object.defineProperty(this, 'clear', {configurable: true, value: v}); |
+}}); |
+ |
+// Bindings are lazily initialized. Poke it. |
+chrome.runtime; |
+// If the runtime bindings aren't created, we didn't test anything. |
+if (!chrome.runtime) |
+ addError('chrome.runtime was not created.\n'); |
+ |
+addError(''); |
+</script> |