Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[tests] Automated test for issue 5336

  • Loading branch information...
commit 1118bed1efe8ac8b020f983112f628fd6fb2907b 1 parent 2c8d6bb
@janodvarko janodvarko authored
View
37 tests/content/script/watch/5336/issue5336.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title>Issue 5336: HTMLCollection object is undefined in the Script panel</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+ <link href="../../../_common/testcase.css" type="text/css" rel="stylesheet"/>
+</head>
+<body>
+<script>
+function onClick()
+{
+ var elements = document.getElementsByClassName("test");
+ debugger;
+}
+</script>
+<header>
+ <h1><a href="http://code.google.com/p/fbug/issues/detail?id=5336">Issue 5336</a>:
+ HTMLCollection object is undefined in the Script panel</h1>
+</header>
+<div>
+ <section id="description">
+ <h3>Steps to reproduce</h3>
+ <ol>
+ <li>Enabled the Script panel, reload this page</li>
+ <li>Click this button <button onclick="onClick()" id="testButton">Click Me</button></li>
+ <li>Check the Watch panel, there should be a variable <code>elements</code>
+ with value: <code>[div.test, div.test]</code></li>
+ </ol>
+ </section>
+ <div class="test"></div>
+ <div class="test"></div>
+ <footer>
+ Jan Odvarko, odvarko@gmail.com;
+ </footer>
+</div>
+</body>
+</html>
View
29 tests/content/script/watch/5336/issue5336.js
@@ -0,0 +1,29 @@
+function runTest()
+{
+ FBTest.sysout("issue5336.START");
+ FBTest.openNewTab(basePath + "script/watch/5336/issue5336.html", function(win)
+ {
+ FBTest.openFirebug();
+ FBTest.enableScriptPanel(function(win)
+ {
+ var panel = FW.Firebug.chrome.selectPanel("script");
+
+ FBTest.waitForBreakInDebugger(FW.Firebug.chrome, 13, false, function(row)
+ {
+ FW.Firebug.chrome.selectSidePanel("watches");
+
+ var row = FBTest.getWatchExpressionRow(null, "elements");
+ FBTest.ok(row, "The 'elements' expression must be in the watch panel.");
+
+ var expected = /\s*elements\[\s*div\.test\,\s*div\.test\s*\]\s*/;
+ FBTest.compare(expected, row.textContent,
+ "Value of 'elements' must not be undefined.");
+
+ FBTest.clickContinueButton();
+ FBTest.testDone("issue5336.DONE");
+ });
+
+ FBTest.click(win.document.getElementById("testButton"));
+ });
+ });
+}
Please sign in to comment.
Something went wrong with that request. Please try again.