blob: 357097d133cc72ec9009c15983eb379ffaedbd99 [file] [log] [blame]
/*
* Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
* for details. All rights reserved. Use of this source code is governed by a
* BSD-style license that can be found in the LICENSE file.
*/
/**
* @description Test for the formmethod attribute in button tags.
*/
import "dart:html";
import "../../testcommon.dart";
import "../../../Utils/async_utils.dart";
main() {
document.body.setInnerHtml('''
<form method="get" action="?">
<input type="hidden" name="hidden" value="I am hidden" />
<button id="button" formmethod="post" type="submit" name="button" value="value" />
</form>
''', treeSanitizer: new NullTreeSanitizer());
var url = window.location.href;
var button = document.getElementById('button');
var firstRun = url.indexOf('?') == -1 ||
url.substring(url.indexOf('?')+1, url.length) != "";
if (firstRun) {
button.click();
} else {
shouldBe(url.substring(url.indexOf('?')+1, url.length), "");
}
}