Backed out changeset 6c2f46733945 (bug 1003380) for frequent Android mochitest-2 failures.

CLOSED TREE
This commit is contained in:
Ryan VanderMeulen 2014-04-30 14:08:44 -04:00
parent 568d01e29e
commit a8b592efb4
4 changed files with 2 additions and 44 deletions

View File

@ -1490,13 +1490,7 @@ CanvasRenderingContext2D::CreatePattern(const HTMLImageOrCanvasOrVideoElement& e
return pat.forget();
}
} else if (element.IsHTMLImageElement()) {
HTMLImageElement* img = &element.GetAsHTMLImageElement();
if (img->IntrinsicState().HasState(NS_EVENT_STATE_BROKEN)) {
error.Throw(NS_ERROR_DOM_INVALID_STATE_ERR);
return nullptr;
}
htmlElement = img;
htmlElement = &element.GetAsHTMLImageElement();
} else {
htmlElement = &element.GetAsHTMLVideoElement();
}

View File

@ -213,4 +213,3 @@ skip-if = (buildapp == 'b2g' && toolkit != 'gonk')
[test_toDataURL_parameters.html]
[test_windingRuleUndefined.html]
[test_2d.fillText.gradient.html]
[test_createPattern_broken.html]

View File

@ -15108,7 +15108,7 @@ var img = new Image();
todo(img.complete === false, "img.complete === false");
var _thrown = undefined; try {
ctx.createPattern(img, 'repeat');
} catch (e) { _thrown = e }; ok(_thrown && _thrown.name == "InvalidStateError" && _thrown.code == DOMException.INVALID_STATE_ERR, "should throw InvalidStateError");
} catch (e) { _thrown = e }; todo(_thrown && _thrown.name == "InvalidStateError" && _thrown.code == DOMException.INVALID_STATE_ERR, "should throw InvalidStateError");
}

View File

@ -1,35 +0,0 @@
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<title>Test for createPattern with a broken image</title>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="/tests/SimpleTest/WindowSnapshot.js"></script>
<script type="application/javascript" src="file_drawWindow_common.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<script type="application/javascript">
SimpleTest.waitForExplicitFinish();
window.addEventListener("load", function(){
var _thrown = undefined;
try{
var img = document.getElementById('broken.png');
var ctx = document.getElementById('c').getContext('2d');
var p = ctx.createPattern(img, 'repeat');
} catch (e) {
_thrown = e
};
ok(_thrown && _thrown.name == "InvalidStateError" && _thrown.code == DOMException.INVALID_STATE_ERR, "should throw InvalidStateError");
SimpleTest.finish();
});
</script>
</head>
<body>
<canvas id="c" class="output" width="100" height="50"></canvas>
<img src="/images/broken.png" id="broken.png" class="resource"/>
</body>
</html>