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

Unified Diff: chrome/browser/chromeos/dbus/flimflam_client_unittest_base.h

Issue 9838085: Move files inside chrome/browser/chromeos/dbus to chromeos/dbus (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Rebase Created 8 years, 8 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/chromeos/dbus/flimflam_client_unittest_base.h
diff --git a/chrome/browser/chromeos/dbus/flimflam_client_unittest_base.h b/chrome/browser/chromeos/dbus/flimflam_client_unittest_base.h
deleted file mode 100644
index cf59bb119d6ba1acc86b688ff2d653789df7438a..0000000000000000000000000000000000000000
--- a/chrome/browser/chromeos/dbus/flimflam_client_unittest_base.h
+++ /dev/null
@@ -1,123 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef CHROME_BROWSER_CHROMEOS_DBUS_FLIMFLAM_CLIENT_UNITTEST_BASE_H_
-#define CHROME_BROWSER_CHROMEOS_DBUS_FLIMFLAM_CLIENT_UNITTEST_BASE_H_
-
-#include <string>
-
-#include "base/memory/ref_counted.h"
-#include "base/memory/scoped_ptr.h"
-#include "base/message_loop.h"
-#include "chrome/browser/chromeos/dbus/dbus_method_call_status.h"
-#include "dbus/mock_bus.h"
-#include "dbus/mock_object_proxy.h"
-#include "dbus/object_proxy.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-namespace base {
-
-class Value;
-class DictionaryValue;
-
-} // namespace base
-
-namespace dbus {
-
-class MessageReader;
-
-} // namespace dbus
-
-namespace chromeos {
-
-// A class to provide functionalities needed for testing Flimflam D-Bus clients.
-class FlimflamClientUnittestBase : public testing::Test {
- public:
- explicit FlimflamClientUnittestBase(const std::string& interface_name);
- virtual ~FlimflamClientUnittestBase();
-
- virtual void SetUp() OVERRIDE;
- virtual void TearDown() OVERRIDE;
-
- protected:
- // A callback to intercept and check the method call arguments.
- typedef base::Callback<void(
- dbus::MessageReader* reader)> ArgumentCheckCallback;
-
- // Sets expectations for called method name and arguments, and sets response.
- void PrepareForMethodCall(const std::string& method_name,
- ArgumentCheckCallback argument_checker,
- dbus::Response* response);
-
- // Sends property changed signal to the tested client.
- void SendPropertyChangedSignal(dbus::Signal* signal);
-
- // Checks the name and the value which are sent by PropertyChanged signal.
- static void ExpectPropertyChanged(const std::string& expected_name,
- const base::Value* expected_value,
- const std::string& name,
- const base::Value& value);
-
- // Expects the reader to be empty.
- static void ExpectNoArgument(dbus::MessageReader* reader);
-
- // Expects the reader to have a string.
- static void ExpectStringArgument(const std::string& expected_string,
- dbus::MessageReader* reader);
-
- // Expects the reader to have a Value.
- static void ExpectValueArgument(const base::Value* expected_value,
- dbus::MessageReader* reader);
-
- // Expects the reader to have a string and a Value.
- static void ExpectStringAndValueArguments(const std::string& expected_string,
- const base::Value* expected_value,
- dbus::MessageReader* reader);
-
- // Expects the call status to be SUCCESS.
- static void ExpectNoResultValue(DBusMethodCallStatus call_status);
-
- // Checks the result and expects the call status to be SUCCESS.
- static void ExpectDictionaryValueResult(
- const base::DictionaryValue* expected_result,
- DBusMethodCallStatus call_status,
- const base::DictionaryValue& result);
-
- // A message loop to emulate asynchronous behavior.
- MessageLoop message_loop_;
- // The mock bus.
- scoped_refptr<dbus::MockBus> mock_bus_;
-
- private:
- // Checks the requested interface name and signal name.
- // Used to implement the mock proxy.
- void OnConnectToSignal(
- const std::string& interface_name,
- const std::string& signal_name,
- dbus::ObjectProxy::SignalCallback signal_callback,
- dbus::ObjectProxy::OnConnectedCallback on_connected_callback);
-
- // Checks the content of the method call and returns the response.
- // Used to implement the mock proxy.
- void OnCallMethod(dbus::MethodCall* method_call,
- int timeout_ms,
- dbus::ObjectProxy::ResponseCallback response_callback);
-
- // The interface name.
- const std::string interface_name_;
- // The mock object proxy.
- scoped_refptr<dbus::MockObjectProxy> mock_proxy_;
- // The PropertyChanged signal handler given by the tested client.
- dbus::ObjectProxy::SignalCallback property_changed_handler_;
- // The name of the method which is expected to be called.
- std::string expected_method_name_;
- // The response which the mock object proxy returns.
- dbus::Response* response_;
- // A callback to intercept and check the method call arguments.
- ArgumentCheckCallback argument_checker_;
-};
-
-} // namespace chromeos
-
-#endif // CHROME_BROWSER_CHROMEOS_DBUS_FLIMFLAM_CLIENT_UNITTEST_BASE_H_
« no previous file with comments | « chrome/browser/chromeos/dbus/flimflam_client_helper.cc ('k') | chrome/browser/chromeos/dbus/flimflam_client_unittest_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698