| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/file_path.h" | 5 #include "base/file_path.h" |
| 6 #include "base/file_util.h" | 6 #include "base/file_util.h" |
| 7 #include "base/stl_util-inl.h" |
| 7 #include "base/string_util.h" | 8 #include "base/string_util.h" |
| 8 #include "base/path_service.h" | 9 #include "base/path_service.h" |
| 9 #include "base/time.h" | 10 #include "base/time.h" |
| 10 #include "chrome/browser/sessions/session_backend.h" | 11 #include "chrome/browser/sessions/session_backend.h" |
| 11 #include "chrome/common/stl_util-inl.h" | |
| 12 #include "testing/gtest/include/gtest/gtest.h" | 12 #include "testing/gtest/include/gtest/gtest.h" |
| 13 | 13 |
| 14 namespace { | 14 namespace { |
| 15 | 15 |
| 16 typedef std::vector<SessionCommand*> SessionCommands; | 16 typedef std::vector<SessionCommand*> SessionCommands; |
| 17 | 17 |
| 18 struct TestData { | 18 struct TestData { |
| 19 SessionCommand::id_type command_id; | 19 SessionCommand::id_type command_id; |
| 20 std::string data; | 20 std::string data; |
| 21 }; | 21 }; |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 202 backend = NULL; | 202 backend = NULL; |
| 203 backend = new SessionBackend(BaseSessionService::SESSION_RESTORE, path_); | 203 backend = new SessionBackend(BaseSessionService::SESSION_RESTORE, path_); |
| 204 backend->ReadLastSessionCommandsImpl(&commands); | 204 backend->ReadLastSessionCommandsImpl(&commands); |
| 205 | 205 |
| 206 // And make sure we get back the expected data. | 206 // And make sure we get back the expected data. |
| 207 ASSERT_EQ(1U, commands.size()); | 207 ASSERT_EQ(1U, commands.size()); |
| 208 AssertCommandEqualsData(second_data, commands[0]); | 208 AssertCommandEqualsData(second_data, commands[0]); |
| 209 | 209 |
| 210 STLDeleteElements(&commands); | 210 STLDeleteElements(&commands); |
| 211 } | 211 } |
| OLD | NEW |