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

Side by Side Diff: chrome/browser/tabs/tab_strip_model_unittest.cc

Issue 8515027: Define the public version of the browser side RenderProcessHost interface. This interface is not ... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 1 month 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 "chrome/browser/tabs/tab_strip_model.h" 5 #include "chrome/browser/tabs/tab_strip_model.h"
6 6
7 #include <map> 7 #include <map>
8 #include <string> 8 #include <string>
9 9
10 #include "base/file_path.h" 10 #include "base/file_path.h"
(...skipping 1729 matching lines...) Expand 10 before | Expand all | Expand 10 after
1740 tabstrip.AppendTabContents(contents2, true); 1740 tabstrip.AppendTabContents(contents2, true);
1741 1741
1742 // Turn on the fake unload listener so the tabs don't actually get shut 1742 // Turn on the fake unload listener so the tabs don't actually get shut
1743 // down when we call CloseAllTabs()---we need to be able to check that 1743 // down when we call CloseAllTabs()---we need to be able to check that
1744 // fast shutdown was attempted. 1744 // fast shutdown was attempted.
1745 delegate.set_run_unload_listener(true); 1745 delegate.set_run_unload_listener(true);
1746 tabstrip.CloseAllTabs(); 1746 tabstrip.CloseAllTabs();
1747 // On a mock RPH this checks whether we *attempted* fast shutdown. 1747 // On a mock RPH this checks whether we *attempted* fast shutdown.
1748 // A real RPH would reject our attempt since there is an unload handler. 1748 // A real RPH would reject our attempt since there is an unload handler.
1749 EXPECT_TRUE(contents1->tab_contents()-> 1749 EXPECT_TRUE(contents1->tab_contents()->
1750 GetRenderProcessHost()->fast_shutdown_started()); 1750 GetRenderProcessHost()->FastShutdownStarted());
1751 EXPECT_EQ(2, tabstrip.count()); 1751 EXPECT_EQ(2, tabstrip.count());
1752 1752
1753 delegate.set_run_unload_listener(false); 1753 delegate.set_run_unload_listener(false);
1754 tabstrip.CloseAllTabs(); 1754 tabstrip.CloseAllTabs();
1755 EXPECT_TRUE(tabstrip.empty()); 1755 EXPECT_TRUE(tabstrip.empty());
1756 } 1756 }
1757 1757
1758 // Make sure fast shutdown is not attempted when only some tabs that share a 1758 // Make sure fast shutdown is not attempted when only some tabs that share a
1759 // RPH are shut down. 1759 // RPH are shut down.
1760 { 1760 {
1761 TabContentsWrapper* contents1 = CreateTabContents(); 1761 TabContentsWrapper* contents1 = CreateTabContents();
1762 TabContentsWrapper* contents2 = 1762 TabContentsWrapper* contents2 =
1763 CreateTabContentsWithSharedRPH(contents1->tab_contents()); 1763 CreateTabContentsWithSharedRPH(contents1->tab_contents());
1764 1764
1765 SetID(contents1->tab_contents(), 1); 1765 SetID(contents1->tab_contents(), 1);
1766 SetID(contents2->tab_contents(), 2); 1766 SetID(contents2->tab_contents(), 2);
1767 1767
1768 tabstrip.AppendTabContents(contents1, true); 1768 tabstrip.AppendTabContents(contents1, true);
1769 tabstrip.AppendTabContents(contents2, true); 1769 tabstrip.AppendTabContents(contents2, true);
1770 1770
1771 tabstrip.CloseTabContentsAt(1, TabStripModel::CLOSE_NONE); 1771 tabstrip.CloseTabContentsAt(1, TabStripModel::CLOSE_NONE);
1772 EXPECT_FALSE(contents1->tab_contents()-> 1772 EXPECT_FALSE(contents1->tab_contents()->
1773 GetRenderProcessHost()->fast_shutdown_started()); 1773 GetRenderProcessHost()->FastShutdownStarted());
1774 EXPECT_EQ(1, tabstrip.count()); 1774 EXPECT_EQ(1, tabstrip.count());
1775 1775
1776 tabstrip.CloseAllTabs(); 1776 tabstrip.CloseAllTabs();
1777 EXPECT_TRUE(tabstrip.empty()); 1777 EXPECT_TRUE(tabstrip.empty());
1778 } 1778 }
1779 } 1779 }
1780 1780
1781 // Tests various permutations of apps. 1781 // Tests various permutations of apps.
1782 TEST_F(TabStripModelTest, Apps) { 1782 TEST_F(TabStripModelTest, Apps) {
1783 TabStripDummyDelegate delegate(NULL); 1783 TabStripDummyDelegate delegate(NULL);
(...skipping 591 matching lines...) Expand 10 before | Expand all | Expand 10 after
2375 ASSERT_EQ(1, observer.GetStateCount()); 2375 ASSERT_EQ(1, observer.GetStateCount());
2376 MockTabStripModelObserver::State s( 2376 MockTabStripModelObserver::State s(
2377 contents2, 1, MockTabStripModelObserver::SELECT); 2377 contents2, 1, MockTabStripModelObserver::SELECT);
2378 s.src_contents = contents2; 2378 s.src_contents = contents2;
2379 s.src_index = 1; 2379 s.src_index = 1;
2380 s.user_gesture = false; 2380 s.user_gesture = false;
2381 EXPECT_TRUE(observer.StateEquals(0, s)); 2381 EXPECT_TRUE(observer.StateEquals(0, s));
2382 strip.RemoveObserver(&observer); 2382 strip.RemoveObserver(&observer);
2383 strip.CloseAllTabs(); 2383 strip.CloseAllTabs();
2384 } 2384 }
OLDNEW
« no previous file with comments | « chrome/browser/tabs/tab_strip_model.cc ('k') | chrome/browser/task_manager/task_manager_notification_resource_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698