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

Unified Diff: components/mus/public/cpp/tests/view_unittest.cc

Issue 1344573002: Mandoline: Rename components/view_manager to components/mus (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 5 years, 3 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
« no previous file with comments | « components/mus/public/cpp/tests/view_manager_test_suite.cc ('k') | components/mus/public/cpp/types.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/mus/public/cpp/tests/view_unittest.cc
diff --git a/components/view_manager/public/cpp/tests/view_unittest.cc b/components/mus/public/cpp/tests/view_unittest.cc
similarity index 93%
rename from components/view_manager/public/cpp/tests/view_unittest.cc
rename to components/mus/public/cpp/tests/view_unittest.cc
index 51c6b5e25eefdf3781e670558b3a36ae72f54000..ca5c3b7453d5b3c9675ac15c3b784c61c58639e6 100644
--- a/components/view_manager/public/cpp/tests/view_unittest.cc
+++ b/components/mus/public/cpp/tests/view_unittest.cc
@@ -2,14 +2,14 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "components/view_manager/public/cpp/view.h"
+#include "components/mus/public/cpp/view.h"
#include "base/logging.h"
#include "base/strings/stringprintf.h"
-#include "components/view_manager/public/cpp/lib/view_private.h"
-#include "components/view_manager/public/cpp/util.h"
-#include "components/view_manager/public/cpp/view_observer.h"
-#include "components/view_manager/public/cpp/view_property.h"
+#include "components/mus/public/cpp/lib/view_private.h"
+#include "components/mus/public/cpp/util.h"
+#include "components/mus/public/cpp/view_observer.h"
+#include "components/mus/public/cpp/view_property.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace mojo {
@@ -21,9 +21,7 @@ typedef testing::Test ViewTest;
// Subclass with public ctor/dtor.
class TestView : public View {
public:
- TestView() {
- ViewPrivate(this).set_id(1);
- }
+ TestView() { ViewPrivate(this).set_id(1); }
~TestView() {}
private:
@@ -191,8 +189,8 @@ typedef testing::Test ViewObserverTest;
bool TreeChangeParamsMatch(const ViewObserver::TreeChangeParams& lhs,
const ViewObserver::TreeChangeParams& rhs) {
- return lhs.target == rhs.target && lhs.old_parent == rhs.old_parent &&
- lhs.new_parent == rhs.new_parent && lhs.receiver == rhs.receiver;
+ return lhs.target == rhs.target && lhs.old_parent == rhs.old_parent &&
+ lhs.new_parent == rhs.new_parent && lhs.receiver == rhs.receiver;
}
class TreeChangeObserver : public ViewObserver {
@@ -202,9 +200,7 @@ class TreeChangeObserver : public ViewObserver {
}
~TreeChangeObserver() override { observee_->RemoveObserver(this); }
- void Reset() {
- received_params_.clear();
- }
+ void Reset() { received_params_.clear(); }
const std::vector<TreeChangeParams>& received_params() {
return received_params_;
@@ -213,9 +209,9 @@ class TreeChangeObserver : public ViewObserver {
private:
// Overridden from ViewObserver:
void OnTreeChanging(const TreeChangeParams& params) override {
- received_params_.push_back(params);
- }
- void OnTreeChanged(const TreeChangeParams& params) override {
+ received_params_.push_back(params);
+ }
+ void OnTreeChanged(const TreeChangeParams& params) override {
received_params_.push_back(params);
}
@@ -565,13 +561,13 @@ namespace {
typedef std::vector<std::string> Changes;
std::string ViewIdToString(Id id) {
- return (id == 0) ? "null" :
- base::StringPrintf("%d,%d", HiWord(id), LoWord(id));
+ return (id == 0) ? "null"
+ : base::StringPrintf("%d,%d", HiWord(id), LoWord(id));
}
std::string RectToString(const Rect& rect) {
- return base::StringPrintf("%d,%d %dx%d",
- rect.x, rect.y, rect.width, rect.height);
+ return base::StringPrintf("%d,%d %dx%d", rect.x, rect.y, rect.width,
+ rect.height);
}
class BoundsChangeObserver : public ViewObserver {
@@ -592,22 +588,18 @@ class BoundsChangeObserver : public ViewObserver {
void OnViewBoundsChanging(View* view,
const Rect& old_bounds,
const Rect& new_bounds) override {
- changes_.push_back(
- base::StringPrintf(
- "view=%s old_bounds=%s new_bounds=%s phase=changing",
- ViewIdToString(view->id()).c_str(),
- RectToString(old_bounds).c_str(),
- RectToString(new_bounds).c_str()));
+ changes_.push_back(base::StringPrintf(
+ "view=%s old_bounds=%s new_bounds=%s phase=changing",
+ ViewIdToString(view->id()).c_str(), RectToString(old_bounds).c_str(),
+ RectToString(new_bounds).c_str()));
}
void OnViewBoundsChanged(View* view,
const Rect& old_bounds,
const Rect& new_bounds) override {
- changes_.push_back(
- base::StringPrintf(
- "view=%s old_bounds=%s new_bounds=%s phase=changed",
- ViewIdToString(view->id()).c_str(),
- RectToString(old_bounds).c_str(),
- RectToString(new_bounds).c_str()));
+ changes_.push_back(base::StringPrintf(
+ "view=%s old_bounds=%s new_bounds=%s phase=changed",
+ ViewIdToString(view->id()).c_str(), RectToString(old_bounds).c_str(),
+ RectToString(new_bounds).c_str()));
}
View* view_;
@@ -830,9 +822,7 @@ typedef std::pair<const void*, intptr_t> PropertyChangeInfo;
class LocalPropertyChangeObserver : public ViewObserver {
public:
explicit LocalPropertyChangeObserver(View* view)
- : view_(view),
- property_key_(nullptr),
- old_property_value_(-1) {
+ : view_(view), property_key_(nullptr), old_property_value_(-1) {
view_->AddObserver(this);
}
~LocalPropertyChangeObserver() override { view_->RemoveObserver(this); }
@@ -877,8 +867,8 @@ TEST_F(ViewObserverTest, LocalPropertyChanged) {
EXPECT_EQ(PropertyChangeInfo(&prop, 3), o.PropertyChangeInfoAndClear());
// Sanity check to see if |PropertyChangeInfoAndClear| really clears.
- EXPECT_EQ(PropertyChangeInfo(
- reinterpret_cast<const void*>(NULL), -3), o.PropertyChangeInfoAndClear());
+ EXPECT_EQ(PropertyChangeInfo(reinterpret_cast<const void*>(NULL), -3),
+ o.PropertyChangeInfoAndClear());
}
} // namespace mojo
« no previous file with comments | « components/mus/public/cpp/tests/view_manager_test_suite.cc ('k') | components/mus/public/cpp/types.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698