| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 #import <Foundation/Foundation.h> | 5 #import <Foundation/Foundation.h> |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
| 10 #include "base/files/file_util.h" | 10 #include "base/files/file_util.h" |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 TEST_F(SessionServiceTest, LoadWindowFromDirectory) { | 124 TEST_F(SessionServiceTest, LoadWindowFromDirectory) { |
| 125 SessionServiceIOS* service = [SessionServiceIOS sharedService]; | 125 SessionServiceIOS* service = [SessionServiceIOS sharedService]; |
| 126 base::scoped_nsobject<SessionWindowIOS> origSessionWindow( | 126 base::scoped_nsobject<SessionWindowIOS> origSessionWindow( |
| 127 [[SessionWindowIOS alloc] init]); | 127 [[SessionWindowIOS alloc] init]); |
| 128 [service performSaveWindow:origSessionWindow toDirectory:directoryName_]; | 128 [service performSaveWindow:origSessionWindow toDirectory:directoryName_]; |
| 129 | 129 |
| 130 SessionWindowIOS* sessionWindow = | 130 SessionWindowIOS* sessionWindow = |
| 131 [service loadWindowForBrowserState:chrome_browser_state_.get()]; | 131 [service loadWindowForBrowserState:chrome_browser_state_.get()]; |
| 132 EXPECT_TRUE(sessionWindow != nil); | 132 EXPECT_TRUE(sessionWindow != nil); |
| 133 EXPECT_EQ(NSNotFound, static_cast<NSInteger>(sessionWindow.selectedIndex)); | 133 EXPECT_EQ(NSNotFound, static_cast<NSInteger>(sessionWindow.selectedIndex)); |
| 134 EXPECT_EQ(0U, sessionWindow.unclaimedSessions); | 134 EXPECT_EQ(0U, sessionWindow.sessions.count); |
| 135 } | 135 } |
| 136 | 136 |
| 137 TEST_F(SessionServiceTest, LoadCorruptedWindow) { | 137 TEST_F(SessionServiceTest, LoadCorruptedWindow) { |
| 138 SessionWindowIOS* sessionWindow = | 138 SessionWindowIOS* sessionWindow = |
| 139 LoadSessionFromTestDataFile(FILE_PATH_LITERAL("corrupted.plist")); | 139 LoadSessionFromTestDataFile(FILE_PATH_LITERAL("corrupted.plist")); |
| 140 EXPECT_TRUE(sessionWindow == nil); | 140 EXPECT_TRUE(sessionWindow == nil); |
| 141 } | 141 } |
| 142 | 142 |
| 143 } // anonymous namespace | 143 } // anonymous namespace |
| OLD | NEW |