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

Side by Side Diff: chrome/browser/sessions/session_service_unittest.cc

Issue 1119005: [Mac] Re-enable pinned tabs; add support for mini-tabs and phantom tabs. (Closed)
Patch Set: Nits Created 10 years, 9 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
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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_util.h" 5 #include "base/file_util.h"
6 #include "base/path_service.h" 6 #include "base/path_service.h"
7 #include "base/scoped_ptr.h" 7 #include "base/scoped_ptr.h"
8 #include "base/scoped_vector.h" 8 #include "base/scoped_vector.h"
9 #include "base/stl_util-inl.h" 9 #include "base/stl_util-inl.h"
10 #include "base/string_util.h" 10 #include "base/string_util.h"
11 #include "base/time.h" 11 #include "base/time.h"
(...skipping 563 matching lines...) Expand 10 before | Expand all | Expand 10 after
575 575
576 ScopedVector<SessionWindow> windows; 576 ScopedVector<SessionWindow> windows;
577 ReadWindows(&(windows.get())); 577 ReadWindows(&(windows.get()));
578 578
579 helper_.AssertSingleWindowWithSingleTab(windows.get(), 1); 579 helper_.AssertSingleWindowWithSingleTab(windows.get(), 1);
580 EXPECT_TRUE(app_id == windows[0]->tabs[0]->app_extension_id); 580 EXPECT_TRUE(app_id == windows[0]->tabs[0]->app_extension_id);
581 } 581 }
582 582
583 // Explicitly set the pinned state to true and make sure we get back true. 583 // Explicitly set the pinned state to true and make sure we get back true.
584 TEST_F(SessionServiceTest, PinnedTrue) { 584 TEST_F(SessionServiceTest, PinnedTrue) {
585 if (!browser_defaults::kEnablePinnedTabs)
586 return;
587
588 EXPECT_TRUE(CreateAndWriteSessionWithOneTab(true, true)); 585 EXPECT_TRUE(CreateAndWriteSessionWithOneTab(true, true));
589 } 586 }
590 587
591 class GetCurrentSessionCallbackHandler { 588 class GetCurrentSessionCallbackHandler {
592 public: 589 public:
593 void OnGotSession(int handle, std::vector<SessionWindow*>* windows) { 590 void OnGotSession(int handle, std::vector<SessionWindow*>* windows) {
594 EXPECT_EQ(1U, windows->size()); 591 EXPECT_EQ(1U, windows->size());
595 EXPECT_EQ(2U, (*windows)[0]->tabs.size()); 592 EXPECT_EQ(2U, (*windows)[0]->tabs.size());
596 EXPECT_EQ(2U, (*windows)[0]->tabs[0]->navigations.size()); 593 EXPECT_EQ(2U, (*windows)[0]->tabs[0]->navigations.size());
597 EXPECT_EQ(GURL("http://bar/1"), 594 EXPECT_EQ(GURL("http://bar/1"),
(...skipping 12 matching lines...) Expand all
610 AddTab(browser(), GURL("http://foo/1")); 607 AddTab(browser(), GURL("http://foo/1"));
611 NavigateAndCommitActiveTab(GURL("http://foo/2")); 608 NavigateAndCommitActiveTab(GURL("http://foo/2"));
612 AddTab(browser(), GURL("http://bar/1")); 609 AddTab(browser(), GURL("http://bar/1"));
613 NavigateAndCommitActiveTab(GURL("http://bar/2")); 610 NavigateAndCommitActiveTab(GURL("http://bar/2"));
614 611
615 CancelableRequestConsumer consumer; 612 CancelableRequestConsumer consumer;
616 GetCurrentSessionCallbackHandler handler; 613 GetCurrentSessionCallbackHandler handler;
617 service()->GetCurrentSession(&consumer, 614 service()->GetCurrentSession(&consumer,
618 NewCallback(&handler, &GetCurrentSessionCallbackHandler::OnGotSession)); 615 NewCallback(&handler, &GetCurrentSessionCallbackHandler::OnGotSession));
619 } 616 }
OLDNEW
« no previous file with comments | « chrome/browser/sessions/session_service.cc ('k') | chrome/browser/sessions/tab_restore_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698