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

Side by Side Diff: views/controls/table/table_view_unittest.cc

Issue 2171006: Mark TreeViewTests as FAILS_ rather than DISABLED_ (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: Created 10 years, 7 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
« no previous file with comments | « no previous file | no next file » | 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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 <vector> 5 #include <vector>
6 6
7 #include "app/table_model.h" 7 #include "app/table_model.h"
8 #include "app/table_model_observer.h" 8 #include "app/table_model_observer.h"
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 #include "base/string_util.h" 10 #include "base/string_util.h"
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
227 class NullModelTableViewTest : public TableViewTest { 227 class NullModelTableViewTest : public TableViewTest {
228 protected: 228 protected:
229 // Creates the model. 229 // Creates the model.
230 TestTableModel* CreateModel() { 230 TestTableModel* CreateModel() {
231 return NULL; 231 return NULL;
232 } 232 }
233 }; 233 };
234 234
235 // Tests ----------------------------------------------------------------------- 235 // Tests -----------------------------------------------------------------------
236 236
237 // Several failing tests below: http://crbug.com/45015
237 // Tests various sorting permutations. 238 // Tests various sorting permutations.
238 TEST_F(TableViewTest, DISABLED_Sort) { 239 TEST_F(TableViewTest, FAILS_Sort) {
239 // Sort by first column descending. 240 // Sort by first column descending.
240 TableView::SortDescriptors sort; 241 TableView::SortDescriptors sort;
241 sort.push_back(TableView::SortDescriptor(0, false)); 242 sort.push_back(TableView::SortDescriptor(0, false));
242 table_->SetSortDescriptors(sort); 243 table_->SetSortDescriptors(sort);
243 VeriyViewOrder(2, 1, 0, -1); 244 VeriyViewOrder(2, 1, 0, -1);
244 if (HasFatalFailure()) 245 if (HasFatalFailure())
245 return; 246 return;
246 247
247 // Sort by second column ascending, first column descending. 248 // Sort by second column ascending, first column descending.
248 sort.clear(); 249 sort.clear();
249 sort.push_back(TableView::SortDescriptor(1, true)); 250 sort.push_back(TableView::SortDescriptor(1, true));
250 sort.push_back(TableView::SortDescriptor(0, false)); 251 sort.push_back(TableView::SortDescriptor(0, false));
251 sort[1].ascending = false; 252 sort[1].ascending = false;
252 table_->SetSortDescriptors(sort); 253 table_->SetSortDescriptors(sort);
253 VeriyViewOrder(1, 0, 2, -1); 254 VeriyViewOrder(1, 0, 2, -1);
254 if (HasFatalFailure()) 255 if (HasFatalFailure())
255 return; 256 return;
256 257
257 // Clear the sort. 258 // Clear the sort.
258 table_->SetSortDescriptors(TableView::SortDescriptors()); 259 table_->SetSortDescriptors(TableView::SortDescriptors());
259 VeriyViewOrder(0, 1, 2, -1); 260 VeriyViewOrder(0, 1, 2, -1);
260 if (HasFatalFailure()) 261 if (HasFatalFailure())
261 return; 262 return;
262 } 263 }
263 264
264 // Tests changing the model while sorted. 265 // Tests changing the model while sorted.
265 TEST_F(TableViewTest, DISABLED_SortThenChange) { 266 TEST_F(TableViewTest, FAILS_SortThenChange) {
266 // Sort by first column descending. 267 // Sort by first column descending.
267 TableView::SortDescriptors sort; 268 TableView::SortDescriptors sort;
268 sort.push_back(TableView::SortDescriptor(0, false)); 269 sort.push_back(TableView::SortDescriptor(0, false));
269 table_->SetSortDescriptors(sort); 270 table_->SetSortDescriptors(sort);
270 VeriyViewOrder(2, 1, 0, -1); 271 VeriyViewOrder(2, 1, 0, -1);
271 if (HasFatalFailure()) 272 if (HasFatalFailure())
272 return; 273 return;
273 274
274 model_->ChangeRow(0, 3, 1); 275 model_->ChangeRow(0, 3, 1);
275 VeriyViewOrder(0, 2, 1, -1); 276 VeriyViewOrder(0, 2, 1, -1);
276 } 277 }
277 278
278 // Tests adding to the model while sorted. 279 // Tests adding to the model while sorted.
279 TEST_F(TableViewTest, DISABLED_AddToSorted) { 280 TEST_F(TableViewTest, FAILS_AddToSorted) {
280 // Sort by first column descending. 281 // Sort by first column descending.
281 TableView::SortDescriptors sort; 282 TableView::SortDescriptors sort;
282 sort.push_back(TableView::SortDescriptor(0, false)); 283 sort.push_back(TableView::SortDescriptor(0, false));
283 table_->SetSortDescriptors(sort); 284 table_->SetSortDescriptors(sort);
284 VeriyViewOrder(2, 1, 0, -1); 285 VeriyViewOrder(2, 1, 0, -1);
285 if (HasFatalFailure()) 286 if (HasFatalFailure())
286 return; 287 return;
287 288
288 // Add row so that it occurs first. 289 // Add row so that it occurs first.
289 model_->AddRow(0, 5, -1); 290 model_->AddRow(0, 5, -1);
290 VeriyViewOrder(0, 3, 2, 1, -1); 291 VeriyViewOrder(0, 3, 2, 1, -1);
291 if (HasFatalFailure()) 292 if (HasFatalFailure())
292 return; 293 return;
293 294
294 // Add row so that it occurs last. 295 // Add row so that it occurs last.
295 model_->AddRow(0, -1, -1); 296 model_->AddRow(0, -1, -1);
296 VeriyViewOrder(1, 4, 3, 2, 0, -1); 297 VeriyViewOrder(1, 4, 3, 2, 0, -1);
297 } 298 }
298 299
299 // Tests selection on sort. 300 // Tests selection on sort.
300 TEST_F(TableViewTest, DISABLED_PersistSelectionOnSort) { 301 TEST_F(TableViewTest, FAILS_PersistSelectionOnSort) {
301 // Select row 0. 302 // Select row 0.
302 table_->Select(0); 303 table_->Select(0);
303 304
304 // Sort by first column descending. 305 // Sort by first column descending.
305 TableView::SortDescriptors sort; 306 TableView::SortDescriptors sort;
306 sort.push_back(TableView::SortDescriptor(0, false)); 307 sort.push_back(TableView::SortDescriptor(0, false));
307 table_->SetSortDescriptors(sort); 308 table_->SetSortDescriptors(sort);
308 VeriyViewOrder(2, 1, 0, -1); 309 VeriyViewOrder(2, 1, 0, -1);
309 if (HasFatalFailure()) 310 if (HasFatalFailure())
310 return; 311 return;
311 312
312 // Make sure 0 is still selected. 313 // Make sure 0 is still selected.
313 EXPECT_EQ(0, table_->FirstSelectedRow()); 314 EXPECT_EQ(0, table_->FirstSelectedRow());
314 } 315 }
315 316
316 // Tests selection iterator with sort. 317 // Tests selection iterator with sort.
317 TEST_F(TableViewTest, PersistMultiSelectionOnSort) { 318 TEST_F(TableViewTest, FAILS_PersistMultiSelectionOnSort) {
318 SetUpMultiSelectTestState(true); 319 SetUpMultiSelectTestState(true);
319 } 320 }
320 321
321 // Tests selection persists after a change when sorted with iterator. 322 // Tests selection persists after a change when sorted with iterator.
322 TEST_F(TableViewTest, PersistMultiSelectionOnChangeWithSort) { 323 TEST_F(TableViewTest, FAILS_PersistMultiSelectionOnChangeWithSort) {
323 SetUpMultiSelectTestState(true); 324 SetUpMultiSelectTestState(true);
324 if (HasFatalFailure()) 325 if (HasFatalFailure())
325 return; 326 return;
326 327
327 model_->ChangeRow(0, 3, 1); 328 model_->ChangeRow(0, 3, 1);
328 329
329 VerifySelectedRows(1, 0, -1); 330 VerifySelectedRows(1, 0, -1);
330 } 331 }
331 332
332 // Tests selection persists after a remove when sorted with iterator. 333 // Tests selection persists after a remove when sorted with iterator.
333 TEST_F(TableViewTest, DISABLED_PersistMultiSelectionOnRemoveWithSort) { 334 TEST_F(TableViewTest, FAILS_PersistMultiSelectionOnRemoveWithSort) {
334 SetUpMultiSelectTestState(true); 335 SetUpMultiSelectTestState(true);
335 if (HasFatalFailure()) 336 if (HasFatalFailure())
336 return; 337 return;
337 338
338 model_->RemoveRow(0); 339 model_->RemoveRow(0);
339 340
340 VerifySelectedRows(0, -1); 341 VerifySelectedRows(0, -1);
341 } 342 }
342 343
343 // Tests selection persists after a add when sorted with iterator. 344 // Tests selection persists after a add when sorted with iterator.
344 TEST_F(TableViewTest, DISABLED_PersistMultiSelectionOnAddWithSort) { 345 TEST_F(TableViewTest, FAILS_PersistMultiSelectionOnAddWithSort) {
345 SetUpMultiSelectTestState(true); 346 SetUpMultiSelectTestState(true);
346 if (HasFatalFailure()) 347 if (HasFatalFailure())
347 return; 348 return;
348 349
349 model_->AddRow(3, 4, 4); 350 model_->AddRow(3, 4, 4);
350 351
351 VerifySelectedRows(0, 1, -1); 352 VerifySelectedRows(0, 1, -1);
352 } 353 }
353 354
354 // Tests selection persists after a change with iterator. 355 // Tests selection persists after a change with iterator.
355 TEST_F(TableViewTest, DISABLED_PersistMultiSelectionOnChange) { 356 TEST_F(TableViewTest, FAILS_PersistMultiSelectionOnChange) {
356 SetUpMultiSelectTestState(false); 357 SetUpMultiSelectTestState(false);
357 if (HasFatalFailure()) 358 if (HasFatalFailure())
358 return; 359 return;
359 360
360 model_->ChangeRow(0, 3, 1); 361 model_->ChangeRow(0, 3, 1);
361 362
362 VerifySelectedRows(1, 0, -1); 363 VerifySelectedRows(1, 0, -1);
363 } 364 }
364 365
365 // Tests selection persists after a remove with iterator. 366 // Tests selection persists after a remove with iterator.
366 TEST_F(TableViewTest, DISABLED_PersistMultiSelectionOnRemove) { 367 TEST_F(TableViewTest, FAILS_PersistMultiSelectionOnRemove) {
367 SetUpMultiSelectTestState(false); 368 SetUpMultiSelectTestState(false);
368 if (HasFatalFailure()) 369 if (HasFatalFailure())
369 return; 370 return;
370 371
371 model_->RemoveRow(0); 372 model_->RemoveRow(0);
372 373
373 VerifySelectedRows(0, -1); 374 VerifySelectedRows(0, -1);
374 } 375 }
375 376
376 // Tests selection persists after a add with iterator. 377 // Tests selection persists after a add with iterator.
377 TEST_F(TableViewTest, DISABLED_PersistMultiSelectionOnAdd) { 378 TEST_F(TableViewTest, FAILS_PersistMultiSelectionOnAdd) {
378 SetUpMultiSelectTestState(false); 379 SetUpMultiSelectTestState(false);
379 if (HasFatalFailure()) 380 if (HasFatalFailure())
380 return; 381 return;
381 382
382 model_->AddRow(3, 4, 4); 383 model_->AddRow(3, 4, 4);
383 384
384 VerifySelectedRows(1, 0, -1); 385 VerifySelectedRows(1, 0, -1);
385 } 386 }
386 387
387 TEST_F(NullModelTableViewTest, NullModel) { 388 TEST_F(NullModelTableViewTest, NullModel) {
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
553 table_->FocusRow(0); 554 table_->FocusRow(0);
554 EXPECT_EQ(0, table_->GetFirstFocusedRow()); 555 EXPECT_EQ(0, table_->GetFirstFocusedRow());
555 556
556 table_->FocusRow(2); 557 table_->FocusRow(2);
557 EXPECT_EQ(2, table_->GetFirstFocusedRow()); 558 EXPECT_EQ(2, table_->GetFirstFocusedRow());
558 559
559 table_->ClearRowFocus(); 560 table_->ClearRowFocus();
560 EXPECT_EQ(-1, table_->GetFirstSelectedRow()); 561 EXPECT_EQ(-1, table_->GetFirstSelectedRow());
561 } 562 }
562 #endif 563 #endif
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698