summaryrefslogtreecommitdiff
path: root/Source/WebKit/chromium/src/js
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@digia.com>2012-10-17 16:21:14 +0200
committerSimon Hausmann <simon.hausmann@digia.com>2012-10-17 16:21:14 +0200
commit8995b83bcbfbb68245f779b64e5517627c6cc6ea (patch)
tree17985605dab9263cc2444bd4d45f189e142cca7c /Source/WebKit/chromium/src/js
parentb9c9652036d5e9f1e29c574f40bc73a35c81ace6 (diff)
downloadqtwebkit-8995b83bcbfbb68245f779b64e5517627c6cc6ea.tar.gz
Imported WebKit commit cf4f8fc6f19b0629f51860cb2d4b25e139d07e00 (http://svn.webkit.org/repository/webkit/trunk@131592)
New snapshot that includes the build fixes for Mac OS X 10.6 and earlier as well as the previously cherry-picked changes
Diffstat (limited to 'Source/WebKit/chromium/src/js')
-rw-r--r--Source/WebKit/chromium/src/js/DevTools.js1
-rw-r--r--Source/WebKit/chromium/src/js/Tests.js84
2 files changed, 85 insertions, 0 deletions
diff --git a/Source/WebKit/chromium/src/js/DevTools.js b/Source/WebKit/chromium/src/js/DevTools.js
index f555419e9..bbdbd9805 100644
--- a/Source/WebKit/chromium/src/js/DevTools.js
+++ b/Source/WebKit/chromium/src/js/DevTools.js
@@ -41,6 +41,7 @@
Preferences.exposeDisableCache = true;
Preferences.showDockToRight = true;
Preferences.exposeFileSystemInspection = true;
+ Preferences.experimentsEnabled = false;
})();}
function buildPlatformExtensionAPI(extensionInfo)
diff --git a/Source/WebKit/chromium/src/js/Tests.js b/Source/WebKit/chromium/src/js/Tests.js
index 68c6742cc..424e41a26 100644
--- a/Source/WebKit/chromium/src/js/Tests.js
+++ b/Source/WebKit/chromium/src/js/Tests.js
@@ -555,6 +555,90 @@ TestSuite.prototype.testPauseInSharedWorkerInitialization = function()
};
+// Regression test for http://webk.it/97466
+TestSuite.prototype.testPageOverlayUpdate = function()
+{
+ var test = this;
+ var records = [];
+ var dispatchOnRecordType = {}
+
+ function addRecord(event)
+ {
+ innerAddRecord(event.data);
+ }
+
+ function innerAddRecord(record)
+ {
+ records.push(record);
+ if (typeof dispatchOnRecordType[record.type] === "function")
+ dispatchOnRecordType[record.type](record);
+
+ if (record.children)
+ record.children.forEach(innerAddRecord);
+ }
+
+ function populatePage()
+ {
+ var div1 = document.createElement("div");
+ div1.id = "div1";
+ // Force accelerated compositing.
+ div1.style.webkitTransform = "translateZ(0)";
+ document.body.appendChild(div1);
+ var div2 = document.createElement("div");
+ div2.id = "div2";
+ document.body.appendChild(div2);
+ }
+
+ function step1()
+ {
+ WebInspector.timelineManager.addEventListener(WebInspector.TimelineManager.EventTypes.TimelineEventRecorded, addRecord);
+ WebInspector.timelineManager.start();
+
+ test.evaluateInConsole_(populatePage.toString() + "; populatePage();" +
+ "inspect(document.getElementById('div1'))", function() {});
+ WebInspector.notifications.addEventListener(WebInspector.ElementsTreeOutline.Events.SelectedNodeChanged, step2);
+ }
+
+ function step2()
+ {
+ WebInspector.notifications.removeEventListener(WebInspector.ElementsTreeOutline.Events.SelectedNodeChanged, step2);
+ setTimeout(step3, 500);
+ }
+
+ function step3()
+ {
+ test.evaluateInConsole_("inspect(document.getElementById('div2'))", function() {});
+ WebInspector.notifications.addEventListener(WebInspector.ElementsTreeOutline.Events.SelectedNodeChanged, step4);
+ }
+
+ function step4()
+ {
+ WebInspector.notifications.removeEventListener(WebInspector.ElementsTreeOutline.Events.SelectedNodeChanged, step4);
+ dispatchOnRecordType.TimeStamp = step5;
+ test.evaluateInConsole_("console.timeStamp('ready')", function() {});
+ }
+
+ function step5()
+ {
+ var types = {};
+ WebInspector.timelineManager.stop();
+ WebInspector.timelineManager.removeEventListener(WebInspector.TimelineManager.EventTypes.TimelineEventRecorded, addRecord);
+ for (var i = 0; i < records.length; ++i)
+ types[records[i].type] = (types[records[i].type] || 0) + 1;
+
+ var frameCount = types["BeginFrame"];
+ // There should be at least two updates caused by selection of nodes.
+ test.assertTrue(frameCount >= 2, "Not enough DevTools overlay updates");
+ // We normally expect up to 3 frames, but allow for a bit more in case
+ // of some unexpected invalidations.
+ test.assertTrue(frameCount < 6, "Too many updates caused by DevTools overlay");
+ test.releaseControl();
+ }
+
+ step1();
+ this.takeControl();
+}
+
TestSuite.prototype.waitForTestResultsInConsole = function()
{
var messages = WebInspector.console.messages;