browser/devtools/sourceeditor/test/browser_editor_history.js

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

michael@0 1 /* vim: set ts=2 et sw=2 tw=80: */
michael@0 2 /* Any copyright is dedicated to the Public Domain.
michael@0 3 http://creativecommons.org/publicdomain/zero/1.0/ */
michael@0 4
michael@0 5 "use strict";
michael@0 6
michael@0 7 function test() {
michael@0 8 waitForExplicitFinish();
michael@0 9 setup((ed, win) => {
michael@0 10 ok(ed.isClean(), "default isClean");
michael@0 11 ok(!ed.canUndo(), "default canUndo");
michael@0 12 ok(!ed.canRedo(), "default canRedo");
michael@0 13
michael@0 14 ed.setText("Hello, World!");
michael@0 15 ok(!ed.isClean(), "isClean");
michael@0 16 ok(ed.canUndo(), "canUndo");
michael@0 17 ok(!ed.canRedo(), "canRedo");
michael@0 18
michael@0 19 ed.undo();
michael@0 20 ok(ed.isClean(), "isClean after undo");
michael@0 21 ok(!ed.canUndo(), "canUndo after undo");
michael@0 22 ok(ed.canRedo(), "canRedo after undo");
michael@0 23
michael@0 24 ed.setText("What's up?");
michael@0 25 ed.setClean();
michael@0 26 ok(ed.isClean(), "isClean after setClean");
michael@0 27 ok(ed.canUndo(), "canUndo after setClean");
michael@0 28 ok(!ed.canRedo(), "canRedo after setClean");
michael@0 29
michael@0 30 teardown(ed, win);
michael@0 31 });
michael@0 32 }

mercurial