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

Side by Side Diff: chrome/browser/tabs/tab_strip_selection_model_unittest.cc

Issue 7033048: Multi-tab: Adding new Notification when tab selection changes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebasing Created 9 years, 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/tabs/tab_strip_selection_model.cc ('k') | chrome/browser/ui/browser.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <algorithm> 5 #include <algorithm>
6 #include <string> 6 #include <string>
7 7
8 #include "base/string_number_conversions.h" 8 #include "base/string_number_conversions.h"
9 #include "chrome/browser/tabs/tab_strip_selection_model.h" 9 #include "chrome/browser/tabs/tab_strip_selection_model.h"
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 TEST_F(TabStripSelectionModelTest, AddSelectionFromAnchorTo) { 166 TEST_F(TabStripSelectionModelTest, AddSelectionFromAnchorTo) {
167 TabStripSelectionModel model; 167 TabStripSelectionModel model;
168 model.SetSelectedIndex(2); 168 model.SetSelectedIndex(2);
169 169
170 model.AddSelectionFromAnchorTo(4); 170 model.AddSelectionFromAnchorTo(4);
171 EXPECT_EQ("active=4 anchor=2 selection=2 3 4", StateAsString(model)); 171 EXPECT_EQ("active=4 anchor=2 selection=2 3 4", StateAsString(model));
172 172
173 model.AddSelectionFromAnchorTo(0); 173 model.AddSelectionFromAnchorTo(0);
174 EXPECT_EQ("active=0 anchor=2 selection=0 1 2 3 4", StateAsString(model)); 174 EXPECT_EQ("active=0 anchor=2 selection=0 1 2 3 4", StateAsString(model));
175 } 175 }
176
177 TEST_F(TabStripSelectionModelTest, Equals) {
178 TabStripSelectionModel model1;
179 model1.SetSelectedIndex(0);
180 model1.AddSelectionFromAnchorTo(4);
181
182 TabStripSelectionModel model2;
183 model2.SetSelectedIndex(0);
184 model2.AddSelectionFromAnchorTo(4);
185
186 EXPECT_TRUE(model1.Equals(model2));
187 EXPECT_TRUE(model2.Equals(model1));
188
189 model2.SetSelectedIndex(0);
190 EXPECT_FALSE(model1.Equals(model2));
191 EXPECT_FALSE(model2.Equals(model1));
192 }
OLDNEW
« no previous file with comments | « chrome/browser/tabs/tab_strip_selection_model.cc ('k') | chrome/browser/ui/browser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698