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

Side by Side Diff: ui/ozone/platform/test/test_window_manager.cc

Issue 1410123003: Rename "test" ozone platform to "headless" (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Final fix Created 5 years, 1 month 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 | « ui/ozone/platform/test/test_window_manager.h ('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
(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 "ui/ozone/platform/test/test_window_manager.h"
6
7 #include "base/files/file_util.h"
8 #include "base/location.h"
9
10 namespace ui {
11
12 TestWindowManager::TestWindowManager(const base::FilePath& dump_location)
13 : location_(dump_location) {
14 }
15
16 TestWindowManager::~TestWindowManager() {
17 DCHECK(thread_checker_.CalledOnValidThread());
18 }
19
20 void TestWindowManager::Initialize() {
21 if (location_.empty())
22 return;
23 if (!DirectoryExists(location_) && !base::CreateDirectory(location_) &&
24 location_ != base::FilePath("/dev/null"))
25 PLOG(FATAL) << "unable to create output directory";
26 if (!base::PathIsWritable(location_))
27 PLOG(FATAL) << "unable to write to output location";
28 }
29
30 int32_t TestWindowManager::AddWindow(TestWindow* window) {
31 return windows_.Add(window);
32 }
33
34 void TestWindowManager::RemoveWindow(int32_t window_id, TestWindow* window) {
35 DCHECK_EQ(window, windows_.Lookup(window_id));
36 windows_.Remove(window_id);
37 }
38
39 TestWindow* TestWindowManager::GetWindow(int32_t window_id) {
40 return windows_.Lookup(window_id);
41 }
42
43 base::FilePath TestWindowManager::base_path() const {
44 return location_;
45 }
46
47 } // namespace ui
OLDNEW
« no previous file with comments | « ui/ozone/platform/test/test_window_manager.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698