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

Side by Side Diff: chrome/browser/browser_unittest.cc

Issue 2807016: Make pinned tabs a little stickier. (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: review comments Created 10 years, 6 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
« no previous file with comments | « chrome/browser/browser.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 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 "chrome/browser/browser.h" 5 #include "chrome/browser/browser.h"
6 #include "testing/gtest/include/gtest/gtest.h" 6 #include "testing/gtest/include/gtest/gtest.h"
7 7
8 namespace { 8 namespace {
9 9
10 const struct NavigationScenario { 10 const struct NavigationScenario {
(...skipping 11 matching lines...) Expand all
22 PageTransition::LINK, 22 PageTransition::LINK,
23 CURRENT_TAB, 23 CURRENT_TAB,
24 NEW_FOREGROUND_TAB }, 24 NEW_FOREGROUND_TAB },
25 // Also works with AUTO_BOOKMARK. 25 // Also works with AUTO_BOOKMARK.
26 { true, 26 { true,
27 "http://www.example.com", 27 "http://www.example.com",
28 "http://www.google.com", 28 "http://www.google.com",
29 PageTransition::AUTO_BOOKMARK, 29 PageTransition::AUTO_BOOKMARK,
30 CURRENT_TAB, 30 CURRENT_TAB,
31 NEW_FOREGROUND_TAB }, 31 NEW_FOREGROUND_TAB },
32 // Also works with TYPED.
33 { true,
34 "http://www.example.com",
35 "http://www.google.com",
36 PageTransition::TYPED,
37 CURRENT_TAB,
38 NEW_FOREGROUND_TAB },
32 // Also happens if the schemes differ. 39 // Also happens if the schemes differ.
33 { true, 40 { true,
34 "ftp://www.example.com", 41 "ftp://www.example.com",
35 "http://www.example.com", 42 "http://www.example.com",
36 PageTransition::LINK, 43 PageTransition::LINK,
37 CURRENT_TAB, 44 CURRENT_TAB,
38 NEW_FOREGROUND_TAB }, 45 NEW_FOREGROUND_TAB },
39 // Don't choke on an empty referrer. 46 // Don't choke on an empty referrer.
40 { true, 47 { true,
41 "ftp://www.example.com", 48 "ftp://www.example.com",
(...skipping 12 matching lines...) Expand all
54 { true, 61 { true,
55 "http://www.example.com", 62 "http://www.example.com",
56 "http://www.google.com", 63 "http://www.google.com",
57 PageTransition::LINK, 64 PageTransition::LINK,
58 NEW_BACKGROUND_TAB, 65 NEW_BACKGROUND_TAB,
59 NEW_BACKGROUND_TAB }, 66 NEW_BACKGROUND_TAB },
60 // Other PageTransition type - no change. 67 // Other PageTransition type - no change.
61 { true, 68 { true,
62 "http://www.example.com", 69 "http://www.example.com",
63 "http://www.google.com", 70 "http://www.google.com",
64 PageTransition::TYPED, 71 PageTransition::RELOAD,
65 CURRENT_TAB, 72 CURRENT_TAB,
66 CURRENT_TAB }, 73 CURRENT_TAB },
67 // Same domain and scheme - no change. 74 // Same domain and scheme - no change.
68 { true, 75 { true,
69 "http://www.google.com/reader", 76 "http://www.google.com/reader",
70 "http://www.google.com", 77 "http://www.google.com",
71 PageTransition::LINK, 78 PageTransition::LINK,
72 CURRENT_TAB, 79 CURRENT_TAB,
73 CURRENT_TAB }, 80 CURRENT_TAB },
74 // Switching between http and https - no change. 81 // Switching between http and https - no change.
(...skipping 18 matching lines...) Expand all
93 for (size_t i = 0; i < arraysize(kNavigationScenarios); ++i) { 100 for (size_t i = 0; i < arraysize(kNavigationScenarios); ++i) {
94 EXPECT_EQ(kNavigationScenarios[i].result_disposition, 101 EXPECT_EQ(kNavigationScenarios[i].result_disposition,
95 Browser::AdjustWindowOpenDispositionForTab( 102 Browser::AdjustWindowOpenDispositionForTab(
96 kNavigationScenarios[i].pinned, 103 kNavigationScenarios[i].pinned,
97 GURL(kNavigationScenarios[i].url), 104 GURL(kNavigationScenarios[i].url),
98 GURL(kNavigationScenarios[i].referrer), 105 GURL(kNavigationScenarios[i].referrer),
99 kNavigationScenarios[i].transition, 106 kNavigationScenarios[i].transition,
100 kNavigationScenarios[i].original_disposition)) << i; 107 kNavigationScenarios[i].original_disposition)) << i;
101 } 108 }
102 } 109 }
OLDNEW
« no previous file with comments | « chrome/browser/browser.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698