| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 "chrome/browser/back_forward_menu_model.h" | 5 #include "chrome/browser/back_forward_menu_model.h" |
| 6 | 6 |
| 7 #include "base/file_path.h" | 7 #include "base/file_path.h" |
| 8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
| 9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
| 10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
| 11 #include "base/utf_string_conversions.h" |
| 11 #include "chrome/browser/profile_manager.h" | 12 #include "chrome/browser/profile_manager.h" |
| 12 #include "chrome/browser/renderer_host/test/test_render_view_host.h" | 13 #include "chrome/browser/renderer_host/test/test_render_view_host.h" |
| 13 #include "chrome/browser/tab_contents/navigation_controller.h" | 14 #include "chrome/browser/tab_contents/navigation_controller.h" |
| 14 #include "chrome/browser/tab_contents/navigation_entry.h" | 15 #include "chrome/browser/tab_contents/navigation_entry.h" |
| 15 #include "chrome/browser/tab_contents/tab_contents.h" | 16 #include "chrome/browser/tab_contents/tab_contents.h" |
| 16 #include "chrome/common/url_constants.h" | 17 #include "chrome/common/url_constants.h" |
| 17 #include "testing/gtest/include/gtest/gtest.h" | 18 #include "testing/gtest/include/gtest/gtest.h" |
| 18 | 19 |
| 19 class BackFwdMenuModelTest : public RenderViewHostTestHarness { | 20 class BackFwdMenuModelTest : public RenderViewHostTestHarness { |
| 20 public: | 21 public: |
| (...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 417 EXPECT_EQ(1, back_model->GetIndexOfNextChapterStop(0, true)); | 418 EXPECT_EQ(1, back_model->GetIndexOfNextChapterStop(0, true)); |
| 418 EXPECT_EQ(3, back_model->GetIndexOfNextChapterStop(1, true)); | 419 EXPECT_EQ(3, back_model->GetIndexOfNextChapterStop(1, true)); |
| 419 EXPECT_EQ(3, back_model->GetIndexOfNextChapterStop(2, true)); | 420 EXPECT_EQ(3, back_model->GetIndexOfNextChapterStop(2, true)); |
| 420 EXPECT_EQ(4, back_model->GetIndexOfNextChapterStop(3, true)); | 421 EXPECT_EQ(4, back_model->GetIndexOfNextChapterStop(3, true)); |
| 421 // And try backwards as well. | 422 // And try backwards as well. |
| 422 EXPECT_EQ(3, back_model->GetIndexOfNextChapterStop(4, false)); | 423 EXPECT_EQ(3, back_model->GetIndexOfNextChapterStop(4, false)); |
| 423 EXPECT_EQ(1, back_model->GetIndexOfNextChapterStop(3, false)); | 424 EXPECT_EQ(1, back_model->GetIndexOfNextChapterStop(3, false)); |
| 424 EXPECT_EQ(1, back_model->GetIndexOfNextChapterStop(2, false)); | 425 EXPECT_EQ(1, back_model->GetIndexOfNextChapterStop(2, false)); |
| 425 EXPECT_EQ(-1, back_model->GetIndexOfNextChapterStop(1, false)); | 426 EXPECT_EQ(-1, back_model->GetIndexOfNextChapterStop(1, false)); |
| 426 } | 427 } |
| OLD | NEW |