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

Side by Side Diff: chrome/test/data/extensions/api_test/bindings/override_exports.html

Issue 1417513003: [Extensions] Don't allow built-in extensions code to be overridden (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Jochen's Created 5 years, 1 month 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 unified diff | Download patch
OLDNEW
(Empty)
1 <!doctype html>
2 <html>
3 <body>
4 This is a body
5 <span id="status"></span>
6 </body>
7 <script>
8 var error = '';
9 var addError = function(newError) {
10 error += newError;
11 var status = error.length == 0 ? 'success' : error;
12 document.getElementById('status').textContent = status;
13 };
14
15 Object.defineProperty(Object.prototype,
16 'handleResponse',
17 {configurable: true, set: function(v) {
18 addError('Intercepted handleResponse\n');
19 Object.defineProperty(
20 this, "handleResponse", {configurable: true, value: v});
21 }});
22
23 Object.defineProperty(Object.prototype,
24 "$set",
25 {configurable: true, set: function(v) {
26 addError('Intercepted $set\n');
27 Object.defineProperty(this, "$set", {configurable: true, value: v});
28 }});
29
30 Object.defineProperty(Object.prototype,
31 "clear",
32 {configurable: true, set: function(v) {
33 addError('Intercepted clear\n');
34 Object.defineProperty(this, 'clear', {configurable: true, value: v});
35 }});
36
37 // Bindings are lazily initialized. Poke it.
38 chrome.runtime;
39 // If the runtime bindings aren't created, we didn't test anything.
40 if (!chrome.runtime)
41 addError('chrome.runtime was not created.\n');
42
43 addError('');
44 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698