| OLD | NEW |
| 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 "base/stringprintf.h" | 5 #include "base/stringprintf.h" |
| 6 #include "base/utf_string_conversions.h" | 6 #include "base/utf_string_conversions.h" |
| 7 #include "chrome/browser/sessions/session_types.h" | 7 #include "chrome/browser/sessions/session_types.h" |
| 8 #include "chrome/browser/sessions/session_service.h" | 8 #include "chrome/browser/sessions/session_service.h" |
| 9 #include "chrome/browser/sessions/session_service_factory.h" | 9 #include "chrome/browser/sessions/session_service_factory.h" |
| 10 #include "chrome/browser/sessions/tab_restore_service.h" | 10 #include "chrome/browser/sessions/tab_restore_service.h" |
| 11 #include "chrome/common/url_constants.h" | 11 #include "chrome/common/url_constants.h" |
| 12 #include "chrome/test/base/chrome_render_view_host_test_harness.h" | 12 #include "chrome/test/base/chrome_render_view_host_test_harness.h" |
| 13 #include "chrome/test/base/chrome_render_view_test.h" | 13 #include "chrome/test/base/chrome_render_view_test.h" |
| 14 #include "chrome/test/base/testing_profile.h" | 14 #include "chrome/test/base/testing_profile.h" |
| 15 #include "content/browser/tab_contents/navigation_controller.h" | |
| 16 #include "content/browser/tab_contents/test_tab_contents.h" | 15 #include "content/browser/tab_contents/test_tab_contents.h" |
| 16 #include "content/public/browser/navigation_controller.h" |
| 17 #include "content/public/browser/navigation_entry.h" | 17 #include "content/public/browser/navigation_entry.h" |
| 18 #include "content/test/render_view_test.h" | 18 #include "content/test/render_view_test.h" |
| 19 #include "testing/gtest/include/gtest/gtest.h" | 19 #include "testing/gtest/include/gtest/gtest.h" |
| 20 #include "third_party/WebKit/Source/WebKit/chromium/public/WebKit.h" | 20 #include "third_party/WebKit/Source/WebKit/chromium/public/WebKit.h" |
| 21 | 21 |
| 22 typedef TabRestoreService::Tab Tab; | 22 typedef TabRestoreService::Tab Tab; |
| 23 | 23 |
| 24 using content::NavigationEntry; | 24 using content::NavigationEntry; |
| 25 | 25 |
| 26 // Create subclass that overrides TimeNow so that we can control the time used | 26 // Create subclass that overrides TimeNow so that we can control the time used |
| (...skipping 605 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 632 for (size_t i = 0; i < max_entries + 5; i++) { | 632 for (size_t i = 0; i < max_entries + 5; i++) { |
| 633 NavigateAndCommit(GURL(StringPrintf("http://%d", static_cast<int>(i)))); | 633 NavigateAndCommit(GURL(StringPrintf("http://%d", static_cast<int>(i)))); |
| 634 service_->CreateHistoricalTab(&controller(), -1); | 634 service_->CreateHistoricalTab(&controller(), -1); |
| 635 } | 635 } |
| 636 | 636 |
| 637 EXPECT_EQ(max_entries, service_->entries_.size()); | 637 EXPECT_EQ(max_entries, service_->entries_.size()); |
| 638 // This should not crash. | 638 // This should not crash. |
| 639 service_->LoadTabsFromLastSession(); | 639 service_->LoadTabsFromLastSession(); |
| 640 EXPECT_EQ(max_entries, service_->entries_.size()); | 640 EXPECT_EQ(max_entries, service_->entries_.size()); |
| 641 } | 641 } |
| OLD | NEW |