OLD | NEW |
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 "chrome/browser/renderer_host/test/test_render_view_host.h" | |
6 #include "chrome/browser/sessions/session_types.h" | 5 #include "chrome/browser/sessions/session_types.h" |
7 #include "chrome/browser/sessions/session_service.h" | 6 #include "chrome/browser/sessions/session_service.h" |
8 #include "chrome/browser/sessions/tab_restore_service.h" | 7 #include "chrome/browser/sessions/tab_restore_service.h" |
9 #include "chrome/browser/tab_contents/navigation_controller.h" | |
10 #include "chrome/browser/tab_contents/navigation_entry.h" | |
11 #include "chrome/browser/tab_contents/test_tab_contents.h" | |
12 #include "chrome/test/render_view_test.h" | 8 #include "chrome/test/render_view_test.h" |
13 #include "chrome/test/testing_profile.h" | 9 #include "chrome/test/testing_profile.h" |
| 10 #include "content/browser/renderer_host/test_render_view_host.h" |
| 11 #include "content/browser/tab_contents/navigation_controller.h" |
| 12 #include "content/browser/tab_contents/navigation_entry.h" |
| 13 #include "content/browser/tab_contents/test_tab_contents.h" |
14 #include "testing/gtest/include/gtest/gtest.h" | 14 #include "testing/gtest/include/gtest/gtest.h" |
15 #include "third_party/WebKit/Source/WebKit/chromium/public/WebKit.h" | 15 #include "third_party/WebKit/Source/WebKit/chromium/public/WebKit.h" |
16 | 16 |
17 // Create subclass that overrides TimeNow so that we can control the time used | 17 // Create subclass that overrides TimeNow so that we can control the time used |
18 // for closed tabs and windows. | 18 // for closed tabs and windows. |
19 class TabRestoreTimeFactory : public TabRestoreService::TimeFactory { | 19 class TabRestoreTimeFactory : public TabRestoreService::TimeFactory { |
20 public: | 20 public: |
21 TabRestoreTimeFactory() : time_(base::Time::Now()) {} | 21 TabRestoreTimeFactory() : time_(base::Time::Now()) {} |
22 | 22 |
23 virtual ~TabRestoreTimeFactory() {} | 23 virtual ~TabRestoreTimeFactory() {} |
(...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
474 ASSERT_EQ(1U, service_->entries().size()); | 474 ASSERT_EQ(1U, service_->entries().size()); |
475 | 475 |
476 // And verify the entry. | 476 // And verify the entry. |
477 TabRestoreService::Entry* restored_entry = service_->entries().front(); | 477 TabRestoreService::Entry* restored_entry = service_->entries().front(); |
478 ASSERT_EQ(TabRestoreService::TAB, restored_entry->type); | 478 ASSERT_EQ(TabRestoreService::TAB, restored_entry->type); |
479 TabRestoreService::Tab* restored_tab = | 479 TabRestoreService::Tab* restored_tab = |
480 static_cast<TabRestoreService::Tab*>(restored_entry); | 480 static_cast<TabRestoreService::Tab*>(restored_entry); |
481 EXPECT_EQ(tab_timestamp.ToInternalValue(), | 481 EXPECT_EQ(tab_timestamp.ToInternalValue(), |
482 restored_tab->timestamp.ToInternalValue()); | 482 restored_tab->timestamp.ToInternalValue()); |
483 } | 483 } |
OLD | NEW |