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

Side by Side Diff: chrome/browser/chromeos/memory/oom_priority_manager_unittest.cc

Issue 138913021: Avoid discarding freshly created background tabs (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase (last_selected) Created 6 years, 10 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 <algorithm> 5 #include <algorithm>
6 #include <vector> 6 #include <vector>
7 7
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/strings/string16.h" 9 #include "base/strings/string16.h"
10 #include "base/time/time.h" 10 #include "base/time/time.h"
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 55
56 { 56 {
57 OomPriorityManager::TabStats stats; 57 OomPriorityManager::TabStats stats;
58 stats.is_playing_audio = true; 58 stats.is_playing_audio = true;
59 stats.renderer_handle = kPlayingAudio; 59 stats.renderer_handle = kPlayingAudio;
60 test_list.push_back(stats); 60 test_list.push_back(stats);
61 } 61 }
62 62
63 { 63 {
64 OomPriorityManager::TabStats stats; 64 OomPriorityManager::TabStats stats;
65 stats.last_selected = now - base::TimeDelta::FromSeconds(10); 65 stats.last_active = now - base::TimeDelta::FromSeconds(10);
66 stats.renderer_handle = kRecent; 66 stats.renderer_handle = kRecent;
67 test_list.push_back(stats); 67 test_list.push_back(stats);
68 } 68 }
69 69
70 { 70 {
71 OomPriorityManager::TabStats stats; 71 OomPriorityManager::TabStats stats;
72 stats.last_selected = now - base::TimeDelta::FromMinutes(15); 72 stats.last_active = now - base::TimeDelta::FromMinutes(15);
73 stats.renderer_handle = kOld; 73 stats.renderer_handle = kOld;
74 test_list.push_back(stats); 74 test_list.push_back(stats);
75 } 75 }
76 76
77 { 77 {
78 OomPriorityManager::TabStats stats; 78 OomPriorityManager::TabStats stats;
79 stats.last_selected = now - base::TimeDelta::FromDays(365); 79 stats.last_active = now - base::TimeDelta::FromDays(365);
80 stats.renderer_handle = kReallyOld; 80 stats.renderer_handle = kReallyOld;
81 test_list.push_back(stats); 81 test_list.push_back(stats);
82 } 82 }
83 83
84 { 84 {
85 OomPriorityManager::TabStats stats; 85 OomPriorityManager::TabStats stats;
86 stats.is_pinned = true; 86 stats.is_pinned = true;
87 stats.last_selected = now - base::TimeDelta::FromDays(365); 87 stats.last_active = now - base::TimeDelta::FromDays(365);
88 stats.renderer_handle = kOldButPinned; 88 stats.renderer_handle = kOldButPinned;
89 test_list.push_back(stats); 89 test_list.push_back(stats);
90 } 90 }
91 91
92 { 92 {
93 OomPriorityManager::TabStats stats; 93 OomPriorityManager::TabStats stats;
94 stats.is_reloadable_ui = true; 94 stats.is_reloadable_ui = true;
95 stats.renderer_handle = kReloadableUI; 95 stats.renderer_handle = kReloadableUI;
96 test_list.push_back(stats); 96 test_list.push_back(stats);
97 } 97 }
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 GURL(chrome::kChromeUIDiscardsURL))); 136 GURL(chrome::kChromeUIDiscardsURL)));
137 EXPECT_FALSE(OomPriorityManager::IsReloadableUI( 137 EXPECT_FALSE(OomPriorityManager::IsReloadableUI(
138 GURL(chrome::kChromeUINetInternalsURL))); 138 GURL(chrome::kChromeUINetInternalsURL)));
139 139
140 // Prefix matches are included. 140 // Prefix matches are included.
141 EXPECT_TRUE(OomPriorityManager::IsReloadableUI( 141 EXPECT_TRUE(OomPriorityManager::IsReloadableUI(
142 GURL("chrome://settings/fakeSetting"))); 142 GURL("chrome://settings/fakeSetting")));
143 } 143 }
144 144
145 } // namespace chromeos 145 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/memory/oom_priority_manager.cc ('k') | chrome/browser/devtools/devtools_target_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698