OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "ios/chrome/browser/ui/tab_switcher/tab_switcher_model.h" | 5 #include "ios/chrome/browser/ui/tab_switcher/tab_switcher_model.h" |
6 | 6 |
7 #include "base/mac/scoped_nsobject.h" | 7 #include "base/mac/scoped_nsobject.h" |
8 #include "base/memory/ptr_util.h" | 8 #include "base/memory/ptr_util.h" |
9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
10 #include "ios/chrome/browser/browser_state/test_chrome_browser_state.h" | 10 #include "ios/chrome/browser/browser_state/test_chrome_browser_state.h" |
11 #include "ios/chrome/browser/ui/ntp/recent_tabs/synced_sessions.h" | 11 #include "ios/chrome/browser/ui/ntp/recent_tabs/synced_sessions.h" |
12 #include "ios/chrome/browser/ui/tab_switcher/session_changes.h" | |
13 #import "ios/chrome/browser/ui/tab_switcher/tab_switcher_model_private.h" | 12 #import "ios/chrome/browser/ui/tab_switcher/tab_switcher_model_private.h" |
14 #import "ios/chrome/browser/ui/tab_switcher/tab_switcher_utils.h" | 13 #import "ios/chrome/browser/ui/tab_switcher/tab_switcher_utils.h" |
15 #include "testing/platform_test.h" | 14 #include "testing/platform_test.h" |
16 #import "third_party/ocmock/OCMock/OCMock.h" | 15 #import "third_party/ocmock/OCMock/OCMock.h" |
17 | 16 |
18 namespace { | 17 namespace { |
19 | 18 |
20 // A lightweight SessionChanges. | |
21 struct LightSessionChanges { | |
22 std::vector<int> updates; | |
23 std::vector<int> deletions; | |
24 std::vector<int> insertions; | |
25 }; | |
26 | |
27 // A lightweight DistantTab. | 19 // A lightweight DistantTab. |
28 class LightDT { | 20 class LightDT { |
29 public: | 21 public: |
30 LightDT(std::string const& urlSuffix, std::string const& title = "") | 22 LightDT(std::string const& urlSuffix, std::string const& title = "") |
31 : url("http://www.foo.com/" + urlSuffix), title(title) {} | 23 : url("http://www.foo.com/" + urlSuffix), title(title) {} |
32 std::string url; | 24 std::string url; |
33 std::string title; | 25 std::string title; |
34 }; | 26 }; |
35 | 27 |
36 // A lightweight DistantSession. | 28 // A lightweight DistantSession. |
(...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
425 [delegate_ expectSessionsRemoved:@[ @1 ]]; | 417 [delegate_ expectSessionsRemoved:@[ @1 ]]; |
426 [delegate_ expectSessionsInserted:@[ @0 ]]; | 418 [delegate_ expectSessionsInserted:@[ @0 ]]; |
427 | 419 |
428 [TabSwitcherModel notifyDelegate:delegate_ | 420 [TabSwitcherModel notifyDelegate:delegate_ |
429 aboutChangeFrom:*old_sessions | 421 aboutChangeFrom:*old_sessions |
430 to:*new_sessions]; | 422 to:*new_sessions]; |
431 [delegate_ verify]; | 423 [delegate_ verify]; |
432 } | 424 } |
433 | 425 |
434 } // namespace | 426 } // namespace |
OLD | NEW |