jinlin
2024-10-22 26ebef24f023a80f5be5ff27c93585f70688f6ee
web/public/SVGOrigin/Method-Draw-master/test/history_test.html
@@ -4,7 +4,7 @@
  <link rel='stylesheet' href='qunit/qunit.css' type='text/css'/>
  <script src='../editor/lib/jquery.js'></script>
  <script type='text/javascript' src='../editor/src/history.js'></script>
  <script type='text/javascript' src='qunit/qunit.js'></script>
  <script type='text/javascript' src='qunit/qunit.js'></script>
  <script type='text/javascript'>
  $(function() {
   // TODO(codedread): Write tests for handling history events.
@@ -54,7 +54,7 @@
   test('Test svgedit.history package', function() {
      expect(13);
      ok(svgedit.history);
      ok(svgedit.history.MoveElementCommand);
      ok(svgedit.history.InsertElementCommand);
@@ -69,11 +69,11 @@
      equals(typeof svgedit.history.BatchCommand, typeof function(){});
      equals(typeof svgedit.history.UndoManager, typeof function(){});
   });
   test('Test UndoManager methods', function() {
      expect(14);
      setUp();
      ok(undoMgr);
      ok(undoMgr.addCommandToHistory);
      ok(undoMgr.getUndoStackSize);
@@ -89,13 +89,13 @@
      equals(typeof undoMgr.resetUndoStack, typeof function(){});
      equals(typeof undoMgr.getNextUndoCommandText, typeof function(){});
      equals(typeof undoMgr.getNextRedoCommandText, typeof function(){});
      tearDown();
   });
   test('Test UndoManager.addCommandToHistory() function', function() {
      expect(3);
      setUp();
      equals(undoMgr.getUndoStackSize(), 0);
@@ -106,10 +106,10 @@
      tearDown();
   });
   test('Test UndoManager.getUndoStackSize() and getRedoStackSize() functions', function() {
      expect(18);
      setUp();
      undoMgr.addCommandToHistory(new MockCommand());
@@ -118,7 +118,7 @@
      equals(undoMgr.getUndoStackSize(), 3);
      equals(undoMgr.getRedoStackSize(), 0);
      undoMgr.undo();
      equals(undoMgr.getUndoStackSize(), 2);
      equals(undoMgr.getRedoStackSize(), 1);
@@ -150,28 +150,28 @@
      undoMgr.redo();
      equals(undoMgr.getUndoStackSize(), 3);
      equals(undoMgr.getRedoStackSize(), 0);
      tearDown();
   });
   test('Test UndoManager.resetUndoStackSize() function', function() {
      expect(4);
      setUp();
      undoMgr.addCommandToHistory(new MockCommand());
      undoMgr.addCommandToHistory(new MockCommand());
      undoMgr.addCommandToHistory(new MockCommand());
      undoMgr.undo();
      equals(undoMgr.getUndoStackSize(), 2);
      equals(undoMgr.getRedoStackSize(), 1);
      undoMgr.resetUndoStack();
      equals(undoMgr.getUndoStackSize(), 0);
      equals(undoMgr.getRedoStackSize(), 0);
      tearDown();
   });
@@ -277,7 +277,7 @@
      undoMgr.undo();
      undoMgr.undo();
      equals(lastCalled, 'cmd2.unapply');
      undoMgr.undo();
      equals(lastCalled, 'cmd1.unapply');
      lastCalled = null;
@@ -287,7 +287,7 @@
      undoMgr.redo();
      equals(lastCalled, 'cmd1.apply');
      undoMgr.redo();
      equals(lastCalled, 'cmd2.apply');
@@ -513,7 +513,7 @@
      var line = document.createElementNS(svgns,'line');
      line.setAttributeNS(null, 'class', 'newClass');
      change = new svgedit.history.ChangeElementCommand(line,{class:'oldClass'});
      ok(change.unapply);
      ok(change.apply);
      equals(typeof change.unapply, typeof function(){});
@@ -524,7 +524,7 @@
      change.apply();
      equals(line.getAttributeNS(null, 'class'), 'newClass');
      tearDown();
   });
@@ -571,8 +571,8 @@
  });
  </script>
</head>
<body>
</head>
<body>
  <h1 id='qunit-header'>Unit Tests for history.js</h1>
  <h2 id='qunit-banner'></h2>
  <h2 id='qunit-userAgent'></h2>
@@ -587,5 +587,5 @@
    <div id='div5'></div>
  </div>
</body>
</body>
</html>