michael@0: /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* vim: set ts=2 et sw=2 tw=80: */ michael@0: /* Any copyright is dedicated to the Public Domain. michael@0: http://creativecommons.org/publicdomain/zero/1.0/ */ michael@0: michael@0: "use strict"; michael@0: michael@0: function test() { michael@0: let testcases = [ michael@0: ["example", {}, "example"], michael@0: ["example", {ctrlKey: true}, "http://www.example.com/"], michael@0: ["example.org", {ctrlKey: true}, "example.org"], michael@0: ["example", {shiftKey: true}, "http://www.example.net/"], michael@0: ["example", {shiftKey: true, ctrlKey: true}, "http://www.example.org/"], michael@0: [" example ", {ctrlKey: true}, "http://www.example.com/"], michael@0: [" example/a ", {ctrlKey: true}, "http://www.example.com/a"] michael@0: ]; michael@0: for (let [input, modifiers, result] of testcases) { michael@0: is(BrowserUI._edit._canonizeURL(input, modifiers), result, input + " -> " + result); michael@0: } michael@0: }