Auto merge of #11454 - asajeffrey:mozbrowser-add-test-setting-location-from-script, r=paulrouget

Added mozbrowser test that location setting from script works.

<!-- Please describe your changes on the following line: -->
Add a mozbrowser test for setting the URL from script
---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] There are tests for these changes

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11454)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2016-06-01 09:13:12 -05:00
commit cba47174e0
2 changed files with 17 additions and 0 deletions

View file

@ -55,5 +55,16 @@ async_test(function(t) {
});
async_test(function(t) {
var iframe = document.createElement("iframe");
iframe.mozbrowser = "true";
iframe.src = "mozbrowserlocationchange_event_iframe.html";
iframe.addEventListener("mozbrowserlocationchange", t.step_func(function(e) {
var url = e.detail.url || e.detail.uri || e.detail;
var filename = url.split("/").pop();
if (filename === "yes.html") { t.done(); }
}));
document.body.appendChild(iframe);
});
</script>
</body>

View file

@ -0,0 +1,6 @@
<html>
<body></body>
<script>
window.location.assign("yes.html");
</script>
</html>