| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "base/bind_helpers.h" | 5 #include "base/bind_helpers.h" |
| 6 #include "base/location.h" | 6 #include "base/location.h" |
| 7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
| 8 #include "base/run_loop.h" | 8 #include "base/run_loop.h" |
| 9 #include "base/single_thread_task_runner.h" | 9 #include "base/single_thread_task_runner.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| (...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 366 EXPECT_EQ(task_management::Task::RENDERER, pre_existing_task->GetType()); | 366 EXPECT_EQ(task_management::Task::RENDERER, pre_existing_task->GetType()); |
| 367 const base::string16 pre_existing_title = pre_existing_task->title(); | 367 const base::string16 pre_existing_title = pre_existing_task->title(); |
| 368 const base::string16 expected_prefix = GetExpectedPrefix(); | 368 const base::string16 expected_prefix = GetExpectedPrefix(); |
| 369 EXPECT_TRUE(base::StartsWith(pre_existing_title, | 369 EXPECT_TRUE(base::StartsWith(pre_existing_title, |
| 370 expected_prefix, | 370 expected_prefix, |
| 371 base::CompareCase::INSENSITIVE_ASCII)); | 371 base::CompareCase::INSENSITIVE_ASCII)); |
| 372 | 372 |
| 373 // Navigating away from the current page in the current tab for which a print | 373 // Navigating away from the current page in the current tab for which a print |
| 374 // preview is displayed will cancel the print preview and hence the task | 374 // preview is displayed will cancel the print preview and hence the task |
| 375 // manger shouldn't show a printing task. | 375 // manger shouldn't show a printing task. |
| 376 ui_test_utils::NavigateToURL(browser(), GURL(chrome::kChromeUINewTabURL)); | 376 ui_test_utils::NavigateToURL(browser(), GURL("about:blank")); |
| 377 EXPECT_EQ(2U, GetTrackedTags().size()); | 377 EXPECT_EQ(2U, GetTrackedTags().size()); |
| 378 EXPECT_EQ(2U, task_manager.tasks().size()); | 378 EXPECT_EQ(2U, task_manager.tasks().size()); |
| 379 | 379 |
| 380 // Now start another print preview after the had already been created and | 380 // Now start another print preview after the had already been created and |
| 381 // validated that a corresponding task is reported. | 381 // validated that a corresponding task is reported. |
| 382 PrintPreview(); | 382 PrintPreview(); |
| 383 EXPECT_EQ(3U, GetTrackedTags().size()); | 383 EXPECT_EQ(3U, GetTrackedTags().size()); |
| 384 EXPECT_EQ(3U, task_manager.tasks().size()); | 384 EXPECT_EQ(3U, task_manager.tasks().size()); |
| 385 const task_management::Task* task = task_manager.tasks().back(); | 385 const task_management::Task* task = task_manager.tasks().back(); |
| 386 EXPECT_EQ(task_management::Task::RENDERER, task->GetType()); | 386 EXPECT_EQ(task_management::Task::RENDERER, task->GetType()); |
| 387 const base::string16 title = task->title(); | 387 const base::string16 title = task->title(); |
| 388 EXPECT_TRUE(base::StartsWith(title, | 388 EXPECT_TRUE(base::StartsWith(title, |
| 389 expected_prefix, | 389 expected_prefix, |
| 390 base::CompareCase::INSENSITIVE_ASCII)); | 390 base::CompareCase::INSENSITIVE_ASCII)); |
| 391 } | 391 } |
| 392 | 392 |
| 393 } // namespace | 393 } // namespace |
| 394 | 394 |
| 395 #endif // defined(ENABLE_TASK_MANAGER) | 395 #endif // defined(ENABLE_TASK_MANAGER) |
| OLD | NEW |