| 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 "chrome/browser/sessions/session_types.h" | 5 #include "chrome/browser/sessions/session_types.h" |
| 6 #include "chrome/browser/sessions/session_service.h" | 6 #include "chrome/browser/sessions/session_service.h" |
| 7 #include "chrome/browser/sessions/session_service_factory.h" | 7 #include "chrome/browser/sessions/session_service_factory.h" |
| 8 #include "chrome/browser/sessions/tab_restore_service.h" | 8 #include "chrome/browser/sessions/tab_restore_service.h" |
| 9 #include "chrome/common/url_constants.h" | 9 #include "chrome/common/url_constants.h" |
| 10 #include "chrome/test/base/render_view_test.h" |
| 10 #include "chrome/test/base/testing_profile.h" | 11 #include "chrome/test/base/testing_profile.h" |
| 11 #include "chrome/test/render_view_test.h" | |
| 12 #include "content/browser/renderer_host/test_render_view_host.h" | 12 #include "content/browser/renderer_host/test_render_view_host.h" |
| 13 #include "content/browser/tab_contents/navigation_controller.h" | 13 #include "content/browser/tab_contents/navigation_controller.h" |
| 14 #include "content/browser/tab_contents/navigation_entry.h" | 14 #include "content/browser/tab_contents/navigation_entry.h" |
| 15 #include "content/browser/tab_contents/test_tab_contents.h" | 15 #include "content/browser/tab_contents/test_tab_contents.h" |
| 16 #include "testing/gtest/include/gtest/gtest.h" | 16 #include "testing/gtest/include/gtest/gtest.h" |
| 17 #include "third_party/WebKit/Source/WebKit/chromium/public/WebKit.h" | 17 #include "third_party/WebKit/Source/WebKit/chromium/public/WebKit.h" |
| 18 | 18 |
| 19 // Create subclass that overrides TimeNow so that we can control the time used | 19 // Create subclass that overrides TimeNow so that we can control the time used |
| 20 // for closed tabs and windows. | 20 // for closed tabs and windows. |
| 21 class TabRestoreTimeFactory : public TabRestoreService::TimeFactory { | 21 class TabRestoreTimeFactory : public TabRestoreService::TimeFactory { |
| (...skipping 495 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 517 ASSERT_EQ(1U, service_->entries().size()); | 517 ASSERT_EQ(1U, service_->entries().size()); |
| 518 | 518 |
| 519 // And verify the entry. | 519 // And verify the entry. |
| 520 TabRestoreService::Entry* restored_entry = service_->entries().front(); | 520 TabRestoreService::Entry* restored_entry = service_->entries().front(); |
| 521 ASSERT_EQ(TabRestoreService::TAB, restored_entry->type); | 521 ASSERT_EQ(TabRestoreService::TAB, restored_entry->type); |
| 522 TabRestoreService::Tab* restored_tab = | 522 TabRestoreService::Tab* restored_tab = |
| 523 static_cast<TabRestoreService::Tab*>(restored_entry); | 523 static_cast<TabRestoreService::Tab*>(restored_entry); |
| 524 EXPECT_EQ(tab_timestamp.ToInternalValue(), | 524 EXPECT_EQ(tab_timestamp.ToInternalValue(), |
| 525 restored_tab->timestamp.ToInternalValue()); | 525 restored_tab->timestamp.ToInternalValue()); |
| 526 } | 526 } |
| OLD | NEW |