Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(150)

Side by Side Diff: chrome/browser/sync/glue/synced_session_tracker_unittest.cc

Issue 8253002: Move PageTransition into content namespace. While I'm touching all these files, I've also updated... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 <string> 5 #include <string>
6 #include <vector> 6 #include <vector>
7 7
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/rand_util.h" 9 #include "base/rand_util.h"
10 #include "base/utf_string_conversions.h" 10 #include "base/utf_string_conversions.h"
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 ASSERT_FALSE(tracker.LookupAllForeignSessions(&sessions)); 57 ASSERT_FALSE(tracker.LookupAllForeignSessions(&sessions));
58 tracker.GetSession("tag1"); 58 tracker.GetSession("tag1");
59 tracker.GetSession("tag2"); 59 tracker.GetSession("tag2");
60 tracker.PutWindowInSession("tag1", 0); 60 tracker.PutWindowInSession("tag1", 0);
61 tracker.PutTabInWindow("tag1", 0, 15, 0); 61 tracker.PutTabInWindow("tag1", 0, 15, 0);
62 SessionTab* tab = tracker.GetTab("tag1", 15); 62 SessionTab* tab = tracker.GetTab("tag1", 15);
63 ASSERT_TRUE(tab); 63 ASSERT_TRUE(tab);
64 tab->navigations.push_back(TabNavigation( 64 tab->navigations.push_back(TabNavigation(
65 0, GURL("valid_url"), GURL("referrer"), 65 0, GURL("valid_url"), GURL("referrer"),
66 string16(ASCIIToUTF16("title")), 66 string16(ASCIIToUTF16("title")),
67 std::string("state"), 0U)); 67 std::string("state"), content::PageTransitionFromInt(0)));
68 ASSERT_TRUE(tracker.LookupAllForeignSessions(&sessions)); 68 ASSERT_TRUE(tracker.LookupAllForeignSessions(&sessions));
69 // Only the session with a valid window and tab gets returned. 69 // Only the session with a valid window and tab gets returned.
70 ASSERT_EQ(1U, sessions.size()); 70 ASSERT_EQ(1U, sessions.size());
71 ASSERT_EQ("tag1", sessions[0]->session_tag); 71 ASSERT_EQ("tag1", sessions[0]->session_tag);
72 } 72 }
73 73
74 TEST_F(SyncedSessionTrackerTest, LookupSessionWindows) { 74 TEST_F(SyncedSessionTrackerTest, LookupSessionWindows) {
75 SyncedSessionTracker tracker; 75 SyncedSessionTracker tracker;
76 std::vector<const SessionWindow*> windows; 76 std::vector<const SessionWindow*> windows;
77 ASSERT_FALSE(tracker.LookupSessionWindows("tag1", &windows)); 77 ASSERT_FALSE(tracker.LookupSessionWindows("tag1", &windows));
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
235 ASSERT_EQ(1U, session2->windows[2]->tabs.size()); 235 ASSERT_EQ(1U, session2->windows[2]->tabs.size());
236 ASSERT_EQ(2U, tracker.num_synced_sessions()); 236 ASSERT_EQ(2U, tracker.num_synced_sessions());
237 ASSERT_EQ(4U, tracker.num_synced_tabs(tag1)); 237 ASSERT_EQ(4U, tracker.num_synced_tabs(tag1));
238 ASSERT_EQ(1U, tracker.num_synced_tabs(tag2)); 238 ASSERT_EQ(1U, tracker.num_synced_tabs(tag2));
239 239
240 // All memory should be properly deallocated by destructor for the 240 // All memory should be properly deallocated by destructor for the
241 // SyncedSessionTracker. 241 // SyncedSessionTracker.
242 } 242 }
243 243
244 } // namespace browser_sync 244 } // namespace browser_sync
OLDNEW
« no previous file with comments | « chrome/browser/sync/glue/session_model_associator_unittest.cc ('k') | chrome/browser/sync/glue/typed_url_change_processor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698