Diff
Modified: trunk/Tools/ChangeLog (116346 => 116347)
--- trunk/Tools/ChangeLog 2012-05-07 20:21:57 UTC (rev 116346)
+++ trunk/Tools/ChangeLog 2012-05-07 20:23:07 UTC (rev 116347)
@@ -1,3 +1,23 @@
+2012-05-07 Ojan Vafai <[email protected]>
+
+ When embedding the flakiness dashboard, hide popups when the frame is blurred.
+ https://bugs.webkit.org/show_bug.cgi?id=85684
+
+ Reviewed by Dirk Pranke.
+
+ If you show a popup, then click elsewhere in garden-o-matic, it will now
+ properly hide it.
+
+ * TestResultServer/static-dashboards/dashboard_base.js:
+ (showPopup):
+ * TestResultServer/static-dashboards/flakiness_dashboard.js:
+ (showPopupForBuild):
+ (generatePageForIndividualTests.if):
+ (generatePageForIndividualTests):
+ * TestResultServer/static-dashboards/flakiness_dashboard_embedded_unittests.js: Added.
+ * TestResultServer/static-dashboards/flakiness_dashboard_unittests.js:
+ * TestResultServer/static-dashboards/run-embedded-unittests.html: Added.
+
2012-05-07 Ian Vollick <[email protected]>
[chromium] WebViewHost should setCompositorSurfaceReady
Modified: trunk/Tools/TestResultServer/static-dashboards/dashboard_base.js (116346 => 116347)
--- trunk/Tools/TestResultServer/static-dashboards/dashboard_base.js 2012-05-07 20:21:57 UTC (rev 116346)
+++ trunk/Tools/TestResultServer/static-dashboards/dashboard_base.js 2012-05-07 20:23:07 UTC (rev 116347)
@@ -805,7 +805,7 @@
popup.parentNode.removeChild(popup);
}
-function showPopup(e, html)
+function showPopup(target, html)
{
var popup = $('popup');
if (!popup) {
@@ -817,7 +817,7 @@
// Set html first so that we can get accurate size metrics on the popup.
popup.innerHTML = html;
- var targetRect = e.target.getBoundingClientRect();
+ var targetRect = target.getBoundingClientRect();
var x = Math.min(targetRect.left - 10, document.documentElement.clientWidth - popup.offsetWidth);
x = Math.max(0, x);
Modified: trunk/Tools/TestResultServer/static-dashboards/flakiness_dashboard.js (116346 => 116347)
--- trunk/Tools/TestResultServer/static-dashboards/flakiness_dashboard.js 2012-05-07 20:21:57 UTC (rev 116346)
+++ trunk/Tools/TestResultServer/static-dashboards/flakiness_dashboard.js 2012-05-07 20:23:07 UTC (rev 116347)
@@ -1015,7 +1015,7 @@
html += '<li>' + linkHTMLToOpenWindow(buildBasePath + pathToFailureLog(opt_testName), 'Failure log') + '</li>';
html += '</ul>';
- showPopup(e, html);
+ showPopup(e.target, html);
}
function htmlForTestResults(test)
@@ -2338,6 +2338,9 @@
parent.postMessage({command: 'heightChanged', height: height}, '*')
}
+if (window != parent)
+ window.addEventListener('blur', hidePopup);
+
document.addEventListener('keydown', function(e) {
if (e.keyIdentifier == 'U+003F' || e.keyIdentifier == 'U+00BF') {
// WebKit MAC retursn 3F. WebKit WIN returns BF. This is a bug!
Added: trunk/Tools/TestResultServer/static-dashboards/flakiness_dashboard_embedded_unittests.js (0 => 116347)
--- trunk/Tools/TestResultServer/static-dashboards/flakiness_dashboard_embedded_unittests.js (rev 0)
+++ trunk/Tools/TestResultServer/static-dashboards/flakiness_dashboard_embedded_unittests.js 2012-05-07 20:23:07 UTC (rev 116347)
@@ -0,0 +1,40 @@
+// Copyright (C) 2011 Google Inc. All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+test('hidePopupOnBlur', 2, function() {
+ showPopup(document.body, 'dummy content');
+ ok(document.querySelector('#popup'));
+
+ // Cause the window to be blurred.
+ var frame = document.createElement('iframe');
+ document.body.appendChild(frame);
+ frame.focus();
+ document.body.removeChild(frame);
+
+ ok(!document.querySelector('#popup'));
+});
\ No newline at end of file
Modified: trunk/Tools/TestResultServer/static-dashboards/flakiness_dashboard_unittests.js (116346 => 116347)
--- trunk/Tools/TestResultServer/static-dashboards/flakiness_dashboard_unittests.js 2012-05-07 20:21:57 UTC (rev 116346)
+++ trunk/Tools/TestResultServer/static-dashboards/flakiness_dashboard_unittests.js 2012-05-07 20:23:07 UTC (rev 116347)
@@ -666,3 +666,10 @@
sortTests(tests, 'bugs', BACKWARD);
deepEqual(tests, [test3, test1, test2]);
});
+
+test('popup', 2, function() {
+ showPopup(document.body, 'dummy content');
+ ok(document.querySelector('#popup'));
+ hidePopup();
+ ok(!document.querySelector('#popup'));
+});
Added: trunk/Tools/TestResultServer/static-dashboards/run-embedded-unittests.html (0 => 116347)
--- trunk/Tools/TestResultServer/static-dashboards/run-embedded-unittests.html (rev 0)
+++ trunk/Tools/TestResultServer/static-dashboards/run-embedded-unittests.html 2012-05-07 20:23:07 UTC (rev 116347)
@@ -0,0 +1,67 @@
+<!DOCTYPE html>
+<!--
+Copyright (C) 2012 Google Inc. All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+THE POSSIBILITY OF SUCH DAMAGE.
+-->
+<html>
+<head>
+<link rel="stylesheet" href=""
+<script src=""
+<script src=""
+<script src=""
+</head>
+<body>
+<h1 id="qunit-header">Test Results Server _javascript_ Unit Tests</h1>
+<h2 id="qunit-banner"></h2>
+<div id="qunit-testrunner-toolbar"></div>
+<h2 id="qunit-userAgent"></h2>
+<ol id="qunit-tests"></ol>
+
+<link rel="stylesheet" href=""
+<link rel="stylesheet" href=""
+<script src=""
+
+<script>
+// Don't request the actual builders off the bots when running unittests.
+function loadBuildersList() {};
+function g_handleBuildersListLoaded() {};
+
+// Mimic being embedded. All our embedded checks compare window and parent.
+window.parent = null;
+</script>
+
+<script src=""
+<script src=""
+
+<script>
+window.location.href = '';
+var builderGroup = '@ToT - chromium.org';
+var builders = {'Webkit Linux': '', 'Webkit Linux (dbg)': '', 'Webkit Mac10.5': '', 'Webkit Win': ''};
+onBuilderListLoad(LAYOUT_TESTS_BUILDER_GROUPS, isChromiumWebkitTipOfTreeTestRunner, CHROMIUM_WEBKIT_BUILDER_MASTER, builderGroup, BuilderGroup.TOT_WEBKIT, builders);
+initBuilders();
+</script>
+
+<!-- FIXME: Split this up into multiple unittest.js, e.g. one for builders.js and one for dashboard_base.js. -->
+<script src=""
+</body>
+</html>