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

Unified Diff: LayoutTests/fast/xmlhttprequest/xmlhttprequest-get.xhtml

Issue 79953004: Improve fidelity of XHR progress events. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Make test stable Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | LayoutTests/fast/xmlhttprequest/xmlhttprequest-get-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/fast/xmlhttprequest/xmlhttprequest-get.xhtml
diff --git a/LayoutTests/fast/xmlhttprequest/xmlhttprequest-get.xhtml b/LayoutTests/fast/xmlhttprequest/xmlhttprequest-get.xhtml
index 0eba42b8066bfa78b6034668de536601b9404872..22adaba47808f2bf73be987f16f5e9d39660bb87 100644
--- a/LayoutTests/fast/xmlhttprequest/xmlhttprequest-get.xhtml
+++ b/LayoutTests/fast/xmlhttprequest/xmlhttprequest-get.xhtml
@@ -44,6 +44,10 @@ if (window.testRunner) {
testRunner.waitUntilDone();
}
+// Some properties do not have stable/guaranteed values;
+// emit default values for these.
+var propertiesWithDefaultValues = {loaded: 0, total: 0, position: 0, totalSize: 0};
+
function myfunc(e)
{
document.getElementById("id1").firstChild.nodeValue = p.responseText;
@@ -67,10 +71,11 @@ function myfunc(e)
var eventProperties = "";
for (i in propNames) {
var prop = propNames[i];
- eventProperties += prop + " : '" + e[prop] + "'\n";
+ var value = (prop in propertiesWithDefaultValues) ? propertiesWithDefaultValues[prop] : e[prop];
+ eventProperties += prop + " : '" + value + "'\n";
}
-
- document.getElementById("id7").firstChild.nodeValue =
+
+ document.getElementById("id7").firstChild.nodeValue =
"Event object: " + e + "\n" +
"Event properties:\n" + eventProperties;
« no previous file with comments | « no previous file | LayoutTests/fast/xmlhttprequest/xmlhttprequest-get-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698