OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/process_singleton.h" | 5 #include "chrome/browser/process_singleton.h" |
6 | 6 |
7 #include <sys/types.h> | 7 #include <sys/types.h> |
8 #include <sys/wait.h> | 8 #include <sys/wait.h> |
9 #include <signal.h> | 9 #include <signal.h> |
10 #include <unistd.h> | 10 #include <unistd.h> |
11 #include <vector> | 11 #include <vector> |
12 #include <string> | 12 #include <string> |
13 | 13 |
14 #include "base/eintr_wrapper.h" | 14 #include "base/eintr_wrapper.h" |
15 #include "base/logging.h" | 15 #include "base/logging.h" |
16 #include "base/path_service.h" | 16 #include "base/path_service.h" |
17 #include "base/string_util.h" | 17 #include "base/string_util.h" |
18 #include "base/thread.h" | 18 #include "base/thread.h" |
| 19 #include "base/utf_string_conversions.h" |
19 #include "chrome/browser/browser.h" | 20 #include "chrome/browser/browser.h" |
20 #include "chrome/browser/browser_process.h" | 21 #include "chrome/browser/browser_process.h" |
21 #include "chrome/common/chrome_constants.h" | 22 #include "chrome/common/chrome_constants.h" |
22 #include "chrome/common/chrome_switches.h" | 23 #include "chrome/common/chrome_switches.h" |
23 #include "chrome/common/chrome_paths.h" | 24 #include "chrome/common/chrome_paths.h" |
24 #include "chrome/test/chrome_process_util.h" | 25 #include "chrome/test/chrome_process_util.h" |
25 #include "chrome/test/ui/ui_test.h" | 26 #include "chrome/test/ui/ui_test.h" |
26 #include "net/base/net_util.h" | 27 #include "net/base/net_util.h" |
27 #include "testing/gtest/include/gtest/gtest.h" | 28 #include "testing/gtest/include/gtest/gtest.h" |
28 | 29 |
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
225 std::string url("about:blank"); | 226 std::string url("about:blank"); |
226 EXPECT_EQ(ProcessSingleton::PROFILE_IN_USE, | 227 EXPECT_EQ(ProcessSingleton::PROFILE_IN_USE, |
227 NotifyOtherProcessOrCreate(url, action_timeout_ms())); | 228 NotifyOtherProcessOrCreate(url, action_timeout_ms())); |
228 } | 229 } |
229 | 230 |
230 // Test that Create fails when another browser is using the profile directory. | 231 // Test that Create fails when another browser is using the profile directory. |
231 TEST_F(ProcessSingletonLinuxTest, CreateFailsWithExistingBrowser) { | 232 TEST_F(ProcessSingletonLinuxTest, CreateFailsWithExistingBrowser) { |
232 scoped_ptr<ProcessSingleton> process_singleton(CreateProcessSingleton()); | 233 scoped_ptr<ProcessSingleton> process_singleton(CreateProcessSingleton()); |
233 EXPECT_FALSE(process_singleton->Create()); | 234 EXPECT_FALSE(process_singleton->Create()); |
234 } | 235 } |
OLD | NEW |