Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(537)

Unified Diff: chrome/browser/resources/shared/js/cr/ui/list_single_selection_model_test.html

Issue 11962043: Move webui resources from chrome\browser\resources\shared to ui\webui\resources. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/resources/shared/js/cr/ui/list_single_selection_model_test.html
===================================================================
--- chrome/browser/resources/shared/js/cr/ui/list_single_selection_model_test.html (revision 177292)
+++ chrome/browser/resources/shared/js/cr/ui/list_single_selection_model_test.html (working copy)
@@ -1,120 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-<title></title>
-<style>
-
-</style>
-<script src="http://closure-library.googlecode.com/svn/trunk/closure/goog/base.js"></script>
-<script src="../../cr.js"></script>
-<script src="../event_target.js"></script>
-<script src="list_single_selection_model.js"></script>
-<script src="list_selection_model_test_util.js"></script>
-<script>
-
-goog.require('goog.testing.jsunit');
-
-</script>
-
-</head>
-<body>
-
-<script>
-
-function createSelectionModel(len, opt_dependentLeadItem) {
- var sm = new cr.ui.ListSingleSelectionModel(len);
- sm.independentLeadItem_ = !opt_dependentLeadItem;
- return sm;
-}
-
-function testAdjust1() {
- var sm = createSelectionModel(200);
-
- sm.leadIndex = sm.anchorIndex = sm.selectedIndex = 100;
- adjust(sm, 0, 10, 0);
-
- assertEquals(90, sm.leadIndex);
- assertEquals(90, sm.anchorIndex);
- assertEquals(90, sm.selectedIndex);
-}
-
-function testAdjust2() {
- var sm = createSelectionModel(200);
-
- sm.leadIndex = sm.anchorIndex = sm.selectedIndex = 50;
- adjust(sm, 60, 10, 0);
-
- assertEquals(50, sm.leadIndex);
- assertEquals(50, sm.anchorIndex);
- assertEquals(50, sm.selectedIndex);
-}
-
-function testAdjust3() {
- var sm = createSelectionModel(200);
-
- sm.leadIndex = sm.anchorIndex = sm.selectedIndex = 100;
- adjust(sm, 0, 0, 10);
-
- assertEquals(110, sm.leadIndex);
- assertEquals(110, sm.anchorIndex);
- assertEquals(110, sm.selectedIndex);
-}
-
-function testAdjust4() {
- var sm = createSelectionModel(100);
-
- sm.leadIndex = sm.anchorIndex = sm.selectedIndex = 99;
-
- adjust(sm, 99, 1, 0);
-
- assertEquals('lead', -1, sm.leadIndex);
- assertEquals('anchor', -1, sm.anchorIndex);
- assertArrayEquals([], sm.selectedIndexes);
-}
-
-function testAdjust5() {
- var sm = createSelectionModel(1);
-
- sm.leadIndex = sm.anchorIndex = sm.selectedIndex = 0;
-
- adjust(sm, 0, 0, 10);
-
- assertEquals('lead', 10, sm.leadIndex);
- assertEquals('anchor', 10, sm.anchorIndex);
- assertArrayEquals([10], sm.selectedIndexes);
-}
-
-function testSelectedIndex1() {
- var sm = createSelectionModel(100, true);
-
- sm.selectedIndex = 99;
-
- assertEquals('lead', 99, sm.leadIndex);
- assertEquals('anchor', 99, sm.anchorIndex);
- assertArrayEquals([99], sm.selectedIndexes);
-}
-
-function testLeadIndex1() {
- var sm = createSelectionModel(100);
-
- sm.leadIndex = 99;
-
- assertEquals('lead', 99, sm.leadIndex);
- assertEquals('anchor', 99, sm.anchorIndex);
- assertArrayEquals([], sm.selectedIndexes);
-}
-
-function testLeadIndex2() {
- var sm = createSelectionModel(100, true);
-
- sm.leadIndex = 99;
-
- assertEquals('lead', -1, sm.leadIndex);
- assertEquals('anchor', -1, sm.anchorIndex);
- assertArrayEquals([], sm.selectedIndexes);
-}
-
-</script>
-
-</body>
-</html>

Powered by Google App Engine
This is Rietveld 408576698