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

Side by Side Diff: chrome/browser/memory/tab_manager_unittest.cc

Issue 1630443002: [Merge M49] [TabManager] Protect tabs that are using camera/microphone. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2623
Patch Set: Created 4 years, 11 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/memory/tab_manager_browsertest.cc ('k') | chrome/browser/memory/tab_stats.h » ('j') | 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) 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 "chrome/browser/memory/tab_manager.h" 5 #include "chrome/browser/memory/tab_manager.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 TabStats stats; 119 TabStats stats;
120 stats.last_active = now; 120 stats.last_active = now;
121 stats.is_app = true; 121 stats.is_app = true;
122 stats.child_process_host_id = kApp; 122 stats.child_process_host_id = kApp;
123 test_list.push_back(stats); 123 test_list.push_back(stats);
124 } 124 }
125 125
126 { 126 {
127 TabStats stats; 127 TabStats stats;
128 stats.last_active = now; 128 stats.last_active = now;
129 stats.is_playing_audio = true; 129 stats.is_media = true;
130 stats.child_process_host_id = kPlayingAudio; 130 stats.child_process_host_id = kPlayingAudio;
131 test_list.push_back(stats); 131 test_list.push_back(stats);
132 } 132 }
133 133
134 { 134 {
135 TabStats stats; 135 TabStats stats;
136 stats.last_active = now; 136 stats.last_active = now;
137 stats.has_form_entry = true; 137 stats.has_form_entry = true;
138 stats.child_process_host_id = kFormEntry; 138 stats.child_process_host_id = kFormEntry;
139 test_list.push_back(stats); 139 test_list.push_back(stats);
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
330 EXPECT_EQ(new_last_active_time, test_contents->GetLastActiveTime()); 330 EXPECT_EQ(new_last_active_time, test_contents->GetLastActiveTime());
331 331
332 WebContents* null_contents = tab_manager.DiscardWebContentsAt(1, &tabstrip); 332 WebContents* null_contents = tab_manager.DiscardWebContentsAt(1, &tabstrip);
333 EXPECT_EQ(new_last_active_time, null_contents->GetLastActiveTime()); 333 EXPECT_EQ(new_last_active_time, null_contents->GetLastActiveTime());
334 334
335 tabstrip.CloseAllTabs(); 335 tabstrip.CloseAllTabs();
336 EXPECT_TRUE(tabstrip.empty()); 336 EXPECT_TRUE(tabstrip.empty());
337 } 337 }
338 338
339 } // namespace memory 339 } // namespace memory
OLDNEW
« no previous file with comments | « chrome/browser/memory/tab_manager_browsertest.cc ('k') | chrome/browser/memory/tab_stats.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698