gecko/browser/metro/base/tests/mochitest/browser_canonizeURL.js
Jonathan Wilde 5d4f293c23 Bug 883390 - Part 1 - Move autocomplete into overlay, centralize urlbar code. r=sfoster
--HG--
rename : browser/metro/base/content/bindings/autocomplete.xml => browser/metro/base/content/bindings/urlbar.xml
extra : rebase_source : a1cedc5a64cf780f76977b1193c60713cb83ef95
2013-07-10 12:14:00 -07:00

22 lines
846 B
JavaScript

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