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

Unified Diff: LayoutTests/fast/history/state-object-few-arguements-exception.html

Issue 1007113002: The history.pushState/replaceState should check for minimum arity exception. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Patch for landing Created 5 years, 9 months 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
Index: LayoutTests/fast/history/state-object-few-arguements-exception.html
diff --git a/LayoutTests/fast/history/state-object-few-arguements-exception.html b/LayoutTests/fast/history/state-object-few-arguements-exception.html
new file mode 100644
index 0000000000000000000000000000000000000000..325de2427063ff78ca9e639d16be2743de5009ca
--- /dev/null
+++ b/LayoutTests/fast/history/state-object-few-arguements-exception.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<script src="../../resources/js-test.js"></script>
+<script>
+
+if (window.testRunner) {
+ testRunner.clearBackForwardList();
+ testRunner.dumpAsText();
+}
+
+function runPushStateTest()
+{
+ shouldThrow('history.pushState()');
+ shouldThrow('history.pushState(null)');
+ shouldNotThrow('history.pushState(null, null)');
+ shouldNotThrow('history.pushState(null, null, null)');
+}
+
+function runReplaceStateTest()
+{
+ shouldThrow('history.replaceState()');
+ shouldThrow('history.replaceState(null)');
+ shouldNotThrow('history.replaceState(null, null)');
+ shouldNotThrow('history.replaceState(null, null, null)');
+}
+
+function runTest()
+{
+ description('This test makes sure that calls to pushState() and replaceState() with less than 2 arguments fail as expected.');
+ runPushStateTest();
+ runReplaceStateTest();
+}
+
+</script>
+<body onload="runTest();">
+<div id=console></div>
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698