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

Unified Diff: chrome/browser/process_singleton_linux_uitest.cc

Issue 9968053: Refactor ProcessSingleton so that it may be used distinctly from a full browser process. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Include cleanup. Created 8 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/process_singleton_linux_uitest.cc
diff --git a/chrome/browser/process_singleton_linux_uitest.cc b/chrome/browser/process_singleton_linux_uitest.cc
index 7d54955b1983120b8e1f9bbebff809d28edaf41b..3c873399e1a9bf3edfd4a161a7e109f521f0ce75 100644
--- a/chrome/browser/process_singleton_linux_uitest.cc
+++ b/chrome/browser/process_singleton_linux_uitest.cc
@@ -11,7 +11,10 @@
#include <vector>
#include <string>
+#include "base/bind.h"
+#include "base/command_line.h"
#include "base/eintr_wrapper.h"
+#include "base/file_path.h"
#include "base/path_service.h"
#include "base/stringprintf.h"
#include "base/test/test_timeouts.h"
@@ -27,6 +30,14 @@
namespace {
+bool UnexpectedNotificationCallback(const CommandLine& command_line,
+ const FilePath& current_directory) {
+ ADD_FAILURE() << "This callback should never be invoked because the active "
+ << "ProcessSingleton is that of the Browser process hosted by "
+ << "UITest.";
+ return false;
+}
+
class ProcessSingletonLinuxTest : public UITest {
public:
virtual void SetUp() {
@@ -94,7 +105,9 @@ ProcessSingleton::NotifyResult NotifyOtherProcessOrCreate(
int timeout_ms) {
scoped_ptr<ProcessSingleton> process_singleton(CreateProcessSingleton());
return process_singleton->NotifyOtherProcessWithTimeoutOrCreate(
- CommandLineForUrl(url), timeout_ms / 1000);
+ CommandLineForUrl(url),
+ base::Bind(&UnexpectedNotificationCallback),
+ timeout_ms / 1000);
}
} // namespace
@@ -271,7 +284,8 @@ TEST_F(ProcessSingletonLinuxTest, NotifyOtherProcessOrCreate_DifferingHost) {
// Test that Create fails when another browser is using the profile directory.
TEST_F(ProcessSingletonLinuxTest, CreateFailsWithExistingBrowser) {
scoped_ptr<ProcessSingleton> process_singleton(CreateProcessSingleton());
- EXPECT_FALSE(process_singleton->Create());
+ EXPECT_FALSE(process_singleton->Create(
+ base::Bind(&UnexpectedNotificationCallback)));
}
// Test that Create fails when another browser is using the profile directory
@@ -289,7 +303,8 @@ TEST_F(ProcessSingletonLinuxTest, CreateChecksCompatibilitySocket) {
socket_path_.value().c_str()));
ASSERT_EQ(0, unlink(cookie_path_.value().c_str()));
- EXPECT_FALSE(process_singleton->Create());
+ EXPECT_FALSE(process_singleton->Create(
+ base::Bind(&UnexpectedNotificationCallback)));
}
// Test that we fail when lock says process is on another host and we can't

Powered by Google App Engine
This is Rietveld 408576698