| 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.h" | 5 #include "base/bind.h" |
| 6 #include "base/bind_helpers.h" | 6 #include "base/bind_helpers.h" |
| 7 #include "base/files/file_util.h" | 7 #include "base/files/file_util.h" |
| 8 #include "base/files/scoped_temp_dir.h" | 8 #include "base/files/scoped_temp_dir.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/memory/scoped_vector.h" | 10 #include "base/memory/scoped_vector.h" |
| (...skipping 804 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 815 helper_.PrepareTabInWindow(window_id, tab_id, 0, true); | 815 helper_.PrepareTabInWindow(window_id, tab_id, 0, true); |
| 816 UpdateNavigation(window_id, tab_id, nav1, true); | 816 UpdateNavigation(window_id, tab_id, nav1, true); |
| 817 | 817 |
| 818 ScopedVector<SessionWindow> windows; | 818 ScopedVector<SessionWindow> windows; |
| 819 ReadWindows(&(windows.get()), NULL); | 819 ReadWindows(&(windows.get()), NULL); |
| 820 | 820 |
| 821 helper_.AssertSingleWindowWithSingleTab(windows.get(), 1); | 821 helper_.AssertSingleWindowWithSingleTab(windows.get(), 1); |
| 822 | 822 |
| 823 // Expected: the HTTP body was removed from the page state of the POST | 823 // Expected: the HTTP body was removed from the page state of the POST |
| 824 // navigation with passwords. | 824 // navigation with passwords. |
| 825 EXPECT_NE(page_state, windows[0]->tabs[0]->navigations[0].page_state()); | 825 EXPECT_NE(page_state.ToEncodedData(), |
| 826 windows[0]->tabs[0]->navigations[0].encoded_page_state()); |
| 826 } | 827 } |
| 827 | 828 |
| 828 // This test is only applicable to chromeos. | 829 // This test is only applicable to chromeos. |
| 829 #if defined(OS_CHROMEOS) | 830 #if defined(OS_CHROMEOS) |
| 830 // Verifies migration of tab/window closed works. | 831 // Verifies migration of tab/window closed works. |
| 831 TEST_F(SessionServiceTest, CanOpenV1TabClosed) { | 832 TEST_F(SessionServiceTest, CanOpenV1TabClosed) { |
| 832 base::FilePath v1_file_path; | 833 base::FilePath v1_file_path; |
| 833 ASSERT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &v1_file_path)); | 834 ASSERT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &v1_file_path)); |
| 834 // v1_session_file contains a tab closed command with the original id. The | 835 // v1_session_file contains a tab closed command with the original id. The |
| 835 // file was generated from ClosingTabStaysClosed. If we successfully processed | 836 // file was generated from ClosingTabStaysClosed. If we successfully processed |
| (...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1041 &cancelable_task_tracker); | 1042 &cancelable_task_tracker); |
| 1042 helper_.RunTaskOnBackendThread( | 1043 helper_.RunTaskOnBackendThread( |
| 1043 FROM_HERE, | 1044 FROM_HERE, |
| 1044 base::Bind(&PostBackToThread, | 1045 base::Bind(&PostBackToThread, |
| 1045 base::Unretained(base::MessageLoop::current()), | 1046 base::Unretained(base::MessageLoop::current()), |
| 1046 base::Unretained(&run_loop))); | 1047 base::Unretained(&run_loop))); |
| 1047 delete helper_.ReleaseService(); | 1048 delete helper_.ReleaseService(); |
| 1048 event.Signal(); | 1049 event.Signal(); |
| 1049 run_loop.Run(); | 1050 run_loop.Run(); |
| 1050 } | 1051 } |
| OLD | NEW |