michael@0: /* Any copyright is dedicated to the Public Domain. michael@0: http://creativecommons.org/publicdomain/zero/1.0/ */ michael@0: michael@0: /** michael@0: * Tests that text entered in the debugger's searchbox is properly parsed. michael@0: */ michael@0: michael@0: function test() { michael@0: initDebugger("about:blank").then(([aTab, aDebuggee, aPanel]) => { michael@0: let filterView = aPanel.panelWin.DebuggerView.Filtering; michael@0: let searchbox = aPanel.panelWin.DebuggerView.Filtering._searchbox; michael@0: michael@0: setText(searchbox, ""); michael@0: is(filterView.searchData.toSource(), '["", [""]]', michael@0: "The searchbox data wasn't parsed correctly (1)."); michael@0: michael@0: setText(searchbox, "#token"); michael@0: is(filterView.searchData.toSource(), '["#", ["", "token"]]', michael@0: "The searchbox data wasn't parsed correctly (2)."); michael@0: michael@0: setText(searchbox, ":42"); michael@0: is(filterView.searchData.toSource(), '[":", ["", 42]]', michael@0: "The searchbox data wasn't parsed correctly (3)."); michael@0: michael@0: setText(searchbox, "#token:42"); michael@0: is(filterView.searchData.toSource(), '["#", ["", "token:42"]]', michael@0: "The searchbox data wasn't parsed correctly (4)."); michael@0: michael@0: setText(searchbox, ":42#token"); michael@0: is(filterView.searchData.toSource(), '["#", [":42", "token"]]', michael@0: "The searchbox data wasn't parsed correctly (5)."); michael@0: michael@0: setText(searchbox, "#token:42#token:42"); michael@0: is(filterView.searchData.toSource(), '["#", ["#token:42", "token:42"]]', michael@0: "The searchbox data wasn't parsed correctly (6)."); michael@0: michael@0: setText(searchbox, ":42#token:42#token"); michael@0: is(filterView.searchData.toSource(), '["#", [":42#token:42", "token"]]', michael@0: "The searchbox data wasn't parsed correctly (7)."); michael@0: michael@0: michael@0: setText(searchbox, "file"); michael@0: is(filterView.searchData.toSource(), '["", ["file"]]', michael@0: "The searchbox data wasn't parsed correctly (8)."); michael@0: michael@0: setText(searchbox, "file#token"); michael@0: is(filterView.searchData.toSource(), '["#", ["file", "token"]]', michael@0: "The searchbox data wasn't parsed correctly (9)."); michael@0: michael@0: setText(searchbox, "file:42"); michael@0: is(filterView.searchData.toSource(), '[":", ["file", 42]]', michael@0: "The searchbox data wasn't parsed correctly (10)."); michael@0: michael@0: setText(searchbox, "file#token:42"); michael@0: is(filterView.searchData.toSource(), '["#", ["file", "token:42"]]', michael@0: "The searchbox data wasn't parsed correctly (11)."); michael@0: michael@0: setText(searchbox, "file:42#token"); michael@0: is(filterView.searchData.toSource(), '["#", ["file:42", "token"]]', michael@0: "The searchbox data wasn't parsed correctly (12)."); michael@0: michael@0: setText(searchbox, "file#token:42#token:42"); michael@0: is(filterView.searchData.toSource(), '["#", ["file#token:42", "token:42"]]', michael@0: "The searchbox data wasn't parsed correctly (13)."); michael@0: michael@0: setText(searchbox, "file:42#token:42#token"); michael@0: is(filterView.searchData.toSource(), '["#", ["file:42#token:42", "token"]]', michael@0: "The searchbox data wasn't parsed correctly (14)."); michael@0: michael@0: michael@0: setText(searchbox, "!token"); michael@0: is(filterView.searchData.toSource(), '["!", ["token"]]', michael@0: "The searchbox data wasn't parsed correctly (15)."); michael@0: michael@0: setText(searchbox, "!token#global"); michael@0: is(filterView.searchData.toSource(), '["!", ["token#global"]]', michael@0: "The searchbox data wasn't parsed correctly (16)."); michael@0: michael@0: setText(searchbox, "!token#global:42"); michael@0: is(filterView.searchData.toSource(), '["!", ["token#global:42"]]', michael@0: "The searchbox data wasn't parsed correctly (17)."); michael@0: michael@0: setText(searchbox, "!token:42#global"); michael@0: is(filterView.searchData.toSource(), '["!", ["token:42#global"]]', michael@0: "The searchbox data wasn't parsed correctly (18)."); michael@0: michael@0: michael@0: setText(searchbox, "@token"); michael@0: is(filterView.searchData.toSource(), '["@", ["token"]]', michael@0: "The searchbox data wasn't parsed correctly (19)."); michael@0: michael@0: setText(searchbox, "@token#global"); michael@0: is(filterView.searchData.toSource(), '["@", ["token#global"]]', michael@0: "The searchbox data wasn't parsed correctly (20)."); michael@0: michael@0: setText(searchbox, "@token#global:42"); michael@0: is(filterView.searchData.toSource(), '["@", ["token#global:42"]]', michael@0: "The searchbox data wasn't parsed correctly (21)."); michael@0: michael@0: setText(searchbox, "@token:42#global"); michael@0: is(filterView.searchData.toSource(), '["@", ["token:42#global"]]', michael@0: "The searchbox data wasn't parsed correctly (22)."); michael@0: michael@0: michael@0: setText(searchbox, "*token"); michael@0: is(filterView.searchData.toSource(), '["*", ["token"]]', michael@0: "The searchbox data wasn't parsed correctly (23)."); michael@0: michael@0: setText(searchbox, "*token#global"); michael@0: is(filterView.searchData.toSource(), '["*", ["token#global"]]', michael@0: "The searchbox data wasn't parsed correctly (24)."); michael@0: michael@0: setText(searchbox, "*token#global:42"); michael@0: is(filterView.searchData.toSource(), '["*", ["token#global:42"]]', michael@0: "The searchbox data wasn't parsed correctly (25)."); michael@0: michael@0: setText(searchbox, "*token:42#global"); michael@0: is(filterView.searchData.toSource(), '["*", ["token:42#global"]]', michael@0: "The searchbox data wasn't parsed correctly (26)."); michael@0: michael@0: michael@0: closeDebuggerAndFinish(aPanel); michael@0: }); michael@0: }