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

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

Issue 1858033002: [ChromeOS] Do not send the memory pressure notification from chrome to renderers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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.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) 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 415 matching lines...) Expand 10 before | Expand all | Expand 10 after
426 test_contents->SetLastActiveTime(new_last_active_time); 426 test_contents->SetLastActiveTime(new_last_active_time);
427 EXPECT_EQ(new_last_active_time, test_contents->GetLastActiveTime()); 427 EXPECT_EQ(new_last_active_time, test_contents->GetLastActiveTime());
428 428
429 WebContents* null_contents = tab_manager.DiscardWebContentsAt(1, &tabstrip); 429 WebContents* null_contents = tab_manager.DiscardWebContentsAt(1, &tabstrip);
430 EXPECT_EQ(new_last_active_time, null_contents->GetLastActiveTime()); 430 EXPECT_EQ(new_last_active_time, null_contents->GetLastActiveTime());
431 431
432 tabstrip.CloseAllTabs(); 432 tabstrip.CloseAllTabs();
433 EXPECT_TRUE(tabstrip.empty()); 433 EXPECT_TRUE(tabstrip.empty());
434 } 434 }
435 435
436 // ChildProcessNotification is disabled on ChromOS. crbug.com/588172.
437 #if !defined(OS_CHROMEOS)
sky 2016/04/04 23:46:35 Can you conditionally run the test? By that I mean
oshima 2016/04/04 23:49:25 Done.
438
436 namespace { 439 namespace {
437 440
438 using MemoryPressureLevel = base::MemoryPressureListener::MemoryPressureLevel; 441 using MemoryPressureLevel = base::MemoryPressureListener::MemoryPressureLevel;
439 442
440 // Function that always indicates the absence of memory pressure. 443 // Function that always indicates the absence of memory pressure.
441 MemoryPressureLevel ReturnNoPressure() { 444 MemoryPressureLevel ReturnNoPressure() {
442 return base::MemoryPressureListener::MEMORY_PRESSURE_LEVEL_NONE; 445 return base::MemoryPressureListener::MEMORY_PRESSURE_LEVEL_NONE;
443 } 446 }
444 447
445 // Function that simply parrots back an externally specified memory pressure 448 // Function that simply parrots back an externally specified memory pressure
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
584 EXPECT_FALSE(tm.under_memory_pressure_); 587 EXPECT_FALSE(tm.under_memory_pressure_);
585 EXPECT_EQ(0u, task_runner->size()); 588 EXPECT_EQ(0u, task_runner->size());
586 EXPECT_EQ(0u, tm.notified_renderers_.size()); 589 EXPECT_EQ(0u, tm.notified_renderers_.size());
587 590
588 591
589 // Clean up the tabstrip. 592 // Clean up the tabstrip.
590 tabstrip.CloseAllTabs(); 593 tabstrip.CloseAllTabs();
591 ASSERT_TRUE(tabstrip.empty()); 594 ASSERT_TRUE(tabstrip.empty());
592 } 595 }
593 596
597 #endif
598
594 } // namespace memory 599 } // namespace memory
OLDNEW
« no previous file with comments | « chrome/browser/memory/tab_manager.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698