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

Side by Side Diff: chrome/browser/sessions/tab_loader_unittest.cc

Issue 2565323002: Stop using callbacks in MemoryCoordinatorProxy (Closed)
Patch Set: fix Created 4 years 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/sessions/tab_loader.h" 5 #include "chrome/browser/sessions/tab_loader.h"
6 6
7 #include "base/memory/memory_coordinator_proxy.h" 7 #include "base/memory/memory_coordinator_proxy.h"
8 #include "base/run_loop.h" 8 #include "base/run_loop.h"
9 #include "base/test/scoped_feature_list.h" 9 #include "base/test/scoped_feature_list.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 // TODO(hajimehoshi): Enable this test on macos when MemoryMonitorMac is 55 // TODO(hajimehoshi): Enable this test on macos when MemoryMonitorMac is
56 // implemented. 56 // implemented.
57 #if defined(OS_MACOSX) 57 #if defined(OS_MACOSX)
58 #define MAYBE_OnMemoryStateChange DISABLED_OnMemoryStateChange 58 #define MAYBE_OnMemoryStateChange DISABLED_OnMemoryStateChange
59 #else 59 #else
60 #define MAYBE_OnMemoryStateChange OnMemoryStateChange 60 #define MAYBE_OnMemoryStateChange OnMemoryStateChange
61 #endif 61 #endif
62 TEST_F(TabLoaderTest, MAYBE_OnMemoryStateChange) { 62 TEST_F(TabLoaderTest, MAYBE_OnMemoryStateChange) {
63 TabLoader::RestoreTabs(restored_tabs_, base::TimeTicks()); 63 TabLoader::RestoreTabs(restored_tabs_, base::TimeTicks());
64 EXPECT_TRUE(TabLoader::shared_tab_loader_->loading_enabled_); 64 EXPECT_TRUE(TabLoader::shared_tab_loader_->loading_enabled_);
65 base::MemoryCoordinatorProxy::GetInstance()->SetCurrentMemoryStateForTesting( 65 base::MemoryCoordinatorProxy::GetInstance()->SetMemoryStateForTesting(
66 base::MemoryState::THROTTLED); 66 base::MemoryState::THROTTLED);
67 // ObserverListThreadsafe is used to notify the state to clients, so running 67 // ObserverListThreadsafe is used to notify the state to clients, so running
68 // the loop is necessary here. 68 // the loop is necessary here.
69 base::RunLoop loop; 69 base::RunLoop loop;
70 loop.RunUntilIdle(); 70 loop.RunUntilIdle();
71 EXPECT_FALSE(TabLoader::shared_tab_loader_->loading_enabled_); 71 EXPECT_FALSE(TabLoader::shared_tab_loader_->loading_enabled_);
72 } 72 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698