diff options
Diffstat (limited to 'contexts/data/lib/closure-library/closure/goog/editor/plugins/linkshortcutplugin_test.html')
-rw-r--r-- | contexts/data/lib/closure-library/closure/goog/editor/plugins/linkshortcutplugin_test.html | 70 |
1 files changed, 0 insertions, 70 deletions
diff --git a/contexts/data/lib/closure-library/closure/goog/editor/plugins/linkshortcutplugin_test.html b/contexts/data/lib/closure-library/closure/goog/editor/plugins/linkshortcutplugin_test.html deleted file mode 100644 index 9de327f..0000000 --- a/contexts/data/lib/closure-library/closure/goog/editor/plugins/linkshortcutplugin_test.html +++ /dev/null @@ -1,70 +0,0 @@ -<!DOCTYPE html> -<html> -<!-- -Copyright 2011 The Closure Library Authors. All Rights Reserved. - -Use of this source code is governed by the Apache License, Version 2.0. -See the COPYING file for details. ---> -<head> -<meta http-equiv="X-UA-Compatible" content="IE=edge"> -<title>goog.editor.plugins.LinkShortcutPlugin Tests</title> -<script src="../../base.js"></script> -<script> - goog.require('goog.dom.Range'); - goog.require('goog.editor.plugins.BasicTextFormatter'); - goog.require('goog.editor.plugins.LinkShortcutPlugin'); - goog.require('goog.editor.plugins.LinkBubble'); - goog.require('goog.editor.Field'); - goog.require('goog.events.KeyCodes'); - goog.require('goog.testing.PropertyReplacer'); - goog.require('goog.testing.dom'); - goog.require('goog.testing.events'); - goog.require('goog.testing.jsunit'); -</script> -</head> -<body> - <div id="cleanup"> - <div id="field">http://www.google.com/</div> - </div> - <script> - var propertyReplacer; - - function setUp() { - propertyReplacer = new goog.testing.PropertyReplacer(); - } - - function tearDown() { - propertyReplacer.reset(); - var field = document.getElementById('cleanup'); - goog.dom.removeChildren(field); - field.innerHTML = '<div id="field">http://www.google.com/</div>'; - } - - function testShortcutCreatesALink() { - propertyReplacer.set(window, 'prompt', function() { - return 'http://www.google.com/'; }); - var linkBubble = new goog.editor.plugins.LinkBubble(); - var formatter = new goog.editor.plugins.BasicTextFormatter(); - var plugin = new goog.editor.plugins.LinkShortcutPlugin(); - var fieldEl = document.getElementById('field'); - var field = new goog.editor.Field('field'); - field.registerPlugin(formatter); - field.registerPlugin(linkBubble); - field.registerPlugin(plugin); - field.makeEditable(); - field.focusAndPlaceCursorAtStart(); - var textNode = goog.testing.dom.findTextNode('http://www.google.com/', - fieldEl); - goog.testing.events.fireKeySequence( - field.getElement(), goog.events.KeyCodes.K, { ctrlKey: true }); - - var href = field.getElement().getElementsByTagName('A')[0]; - assertEquals('http://www.google.com/', href.href); - var bubbleLink = - document.getElementById(goog.editor.plugins.LinkBubble.TEST_LINK_ID_); - assertEquals('http://www.google.com/', bubbleLink.innerHTML); - } - </script> -</body> -</html> |