Home | History | Annotate | Download | only in tabs

Lines Matching refs:model

14 // Returns the state of the selection model as a string. The format is:
16 static std::string StateAsString(const TabStripSelectionModel& model) {
17 std::string result = "active=" + base::IntToString(model.active()) +
18 " anchor=" + base::IntToString(model.anchor()) +
21 model.selected_indices());
31 TabStripSelectionModel model;
32 EXPECT_EQ("active=-1 anchor=-1 selection=", StateAsString(model));
33 EXPECT_TRUE(model.empty());
37 TabStripSelectionModel model;
38 model.SetSelectedIndex(2);
39 EXPECT_EQ("active=2 anchor=2 selection=2", StateAsString(model));
40 EXPECT_FALSE(model.empty());
44 TabStripSelectionModel model;
45 model.SetSelectedIndex(1);
46 model.IncrementFrom(1);
47 EXPECT_EQ("active=2 anchor=2 selection=2", StateAsString(model));
51 model.IncrementFrom(4);
52 EXPECT_EQ("active=2 anchor=2 selection=2", StateAsString(model));
56 TabStripSelectionModel model;
57 model.SetSelectedIndex(2);
58 model.DecrementFrom(0);
59 EXPECT_EQ("active=1 anchor=1 selection=1", StateAsString(model));
63 model.DecrementFrom(1);
64 EXPECT_EQ("active=-1 anchor=-1 selection=", StateAsString(model));
68 model.SetSelectedIndex(2);
69 model.DecrementFrom(4);
70 EXPECT_EQ("active=2 anchor=2 selection=2", StateAsString(model));
74 TabStripSelectionModel model;
75 model.SetSelectedIndex(2);
76 EXPECT_FALSE(model.IsSelected(0));
77 EXPECT_TRUE(model.IsSelected(2));
81 TabStripSelectionModel model;
82 model.AddIndexToSelection(2);
83 EXPECT_EQ("active=-1 anchor=-1 selection=2", StateAsString(model));
85 model.AddIndexToSelection(4);
86 EXPECT_EQ("active=-1 anchor=-1 selection=2 4", StateAsString(model));
90 TabStripSelectionModel model;
91 model.SetSelectedIndex(2);
92 model.AddIndexToSelection(4);
93 EXPECT_EQ("active=2 anchor=2 selection=2 4", StateAsString(model));
95 model.RemoveIndexFromSelection(4);
96 EXPECT_EQ("active=2 anchor=2 selection=2", StateAsString(model));
98 model.RemoveIndexFromSelection(2);
99 EXPECT_EQ("active=2 anchor=2 selection=", StateAsString(model));
103 TabStripSelectionModel model;
104 model.SetSelectedIndex(2);
106 model.Clear();
107 EXPECT_EQ("active=-1 anchor=-1 selection=", StateAsString(model));
111 TabStripSelectionModel model;
112 model.SetSelectedIndex(0);
113 model.AddIndexToSelection(4);
114 model.AddIndexToSelection(10);
115 model.set_anchor(4);
116 model.set_active(4);
117 model.Move(4, 0);
118 EXPECT_EQ("active=0 anchor=0 selection=0 1 10", StateAsString(model));
122 TabStripSelectionModel model;
123 model.SetSelectedIndex(0);
124 model.AddIndexToSelection(4);
125 model.AddIndexToSelection(10);
126 model.set_anchor(0);
127 model.set_active(0);
128 model.Move(0, 3);
129 EXPECT_EQ("active=3 anchor=3 selection=3 4 10", StateAsString(model));
133 TabStripSelectionModel model;
134 model.SetSelectedIndex(0);
135 model.AddIndexToSelection(4);
136 model.AddIndexToSelection(10);
137 EXPECT_EQ("active=0 anchor=0 selection=0 4 10", StateAsString(model));
139 model2.Copy(model);
144 TabStripSelectionModel model;
145 model.SetSelectedIndex(2);
147 model.AddSelectionFromAnchorTo(4);
148 EXPECT_EQ("active=4 anchor=2 selection=2 3 4", StateAsString(model));
150 model.AddSelectionFromAnchorTo(0);
151 EXPECT_EQ("active=0 anchor=2 selection=0 1 2 3 4", StateAsString(model));