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

Side by Side Diff: athena/test/base/test_util.cc

Issue 863033002: Delete athena/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 | « athena/test/base/test_util.h ('k') | athena/test/base/test_windows.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "athena/test/base/test_util.h"
6
7 #include "athena/activity/public/activity.h"
8 #include "athena/activity/public/activity_factory.h"
9 #include "athena/resource_manager/public/resource_manager.h"
10 #include "content/public/browser/notification_service.h"
11 #include "content/public/test/test_utils.h"
12 #include "extensions/browser/notification_types.h"
13
14 namespace athena {
15 namespace test_util {
16
17 void SendTestMemoryPressureEvent(ResourceManager::MemoryPressure pressure) {
18 CHECK(ResourceManager::Get());
19 ResourceManager::Get()->SetMemoryPressureAndStopMonitoring(pressure);
20 WaitUntilIdle();
21 }
22
23 Activity* CreateTestWebActivity(content::BrowserContext* context,
24 const base::string16& title,
25 const GURL& url) {
26 content::WindowedNotificationObserver observer(
27 content::NOTIFICATION_LOAD_STOP,
28 content::NotificationService::AllSources());
29 Activity* activity =
30 ActivityFactory::Get()->CreateWebActivity(context, title, url);
31 Activity::Show(activity);
32 observer.Wait();
33 return activity;
34 }
35
36 void WaitUntilIdle() {
37 base::MessageLoopForUI::current()->RunUntilIdle();
38 }
39
40 } // namespace test_util
41 } // namespace athena
OLDNEW
« no previous file with comments | « athena/test/base/test_util.h ('k') | athena/test/base/test_windows.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698