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/path_service.h" | 15 #include "base/path_service.h" |
16 #include "base/string_util.h" | 16 #include "base/string_util.h" |
17 #include "base/thread.h" | 17 #include "base/thread.h" |
18 #include "base/utf_string_conversions.h" | 18 #include "base/utf_string_conversions.h" |
19 #include "chrome/browser/browser.h" | |
20 #include "chrome/browser/browser_process.h" | 19 #include "chrome/browser/browser_process.h" |
| 20 #include "chrome/browser/ui/browser.h" |
21 #include "chrome/common/chrome_constants.h" | 21 #include "chrome/common/chrome_constants.h" |
| 22 #include "chrome/common/chrome_paths.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/test/chrome_process_util.h" | 24 #include "chrome/test/chrome_process_util.h" |
25 #include "chrome/test/ui/ui_test.h" | 25 #include "chrome/test/ui/ui_test.h" |
26 #include "net/base/net_util.h" | 26 #include "net/base/net_util.h" |
27 #include "testing/gtest/include/gtest/gtest.h" | 27 #include "testing/gtest/include/gtest/gtest.h" |
28 | 28 |
29 namespace { | 29 namespace { |
30 | 30 |
31 class ProcessSingletonLinuxTest : public UITest { | 31 class ProcessSingletonLinuxTest : public UITest { |
32 public: | 32 public: |
33 virtual void SetUp() { | 33 virtual void SetUp() { |
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
291 EXPECT_EQ(0, symlink("INCORRECTCOOKIE", cookie_path_.value().c_str())); | 291 EXPECT_EQ(0, symlink("INCORRECTCOOKIE", cookie_path_.value().c_str())); |
292 | 292 |
293 // Also change the hostname, so the remote does not retry. | 293 // Also change the hostname, so the remote does not retry. |
294 EXPECT_EQ(0, unlink(lock_path_.value().c_str())); | 294 EXPECT_EQ(0, unlink(lock_path_.value().c_str())); |
295 EXPECT_EQ(0, symlink("FAKEFOOHOST-1234", lock_path_.value().c_str())); | 295 EXPECT_EQ(0, symlink("FAKEFOOHOST-1234", lock_path_.value().c_str())); |
296 | 296 |
297 std::string url("about:blank"); | 297 std::string url("about:blank"); |
298 EXPECT_EQ(ProcessSingleton::PROFILE_IN_USE, | 298 EXPECT_EQ(ProcessSingleton::PROFILE_IN_USE, |
299 NotifyOtherProcessOrCreate(url, action_timeout_ms())); | 299 NotifyOtherProcessOrCreate(url, action_timeout_ms())); |
300 } | 300 } |
OLD | NEW |