Commit b546ca9a authored by sky's avatar sky Committed by Commit bot

Removes redundant test

After changes that made Embed() always create a new connection this
test is now redundant with EmbedWithSameViewId*. Additionally it
wasn't properly waiting, leading to use after frees.

BUG=none
TEST=covered by tests
R=aa@chromium.org

Review URL: https://codereview.chromium.org/566463003

Cr-Commit-Position: refs/heads/master@{#294648}
parent 20814d26
...@@ -60,6 +60,11 @@ class ViewManagerProxy : public TestChangeTracker::Delegate { ...@@ -60,6 +60,11 @@ class ViewManagerProxy : public TestChangeTracker::Delegate {
virtual ~ViewManagerProxy() { virtual ~ViewManagerProxy() {
} }
// Returns true if in an initial state. If this returns false it means the
// last test didn't clean up properly, or most likely didn't invoke
// WaitForInstance() when it needed to.
static bool IsInInitialState() { return instance_ == NULL; }
// Runs a message loop until the single instance has been created. // Runs a message loop until the single instance has been created.
static ViewManagerProxy* WaitForInstance() { static ViewManagerProxy* WaitForInstance() {
if (!instance_) if (!instance_)
...@@ -449,6 +454,8 @@ class ViewManagerTest : public testing::Test { ...@@ -449,6 +454,8 @@ class ViewManagerTest : public testing::Test {
connection3_(NULL) {} connection3_(NULL) {}
virtual void SetUp() OVERRIDE { virtual void SetUp() OVERRIDE {
ASSERT_TRUE(ViewManagerProxy::IsInInitialState());
test_helper_.Init(); test_helper_.Init();
test_helper_.SetLoaderForURL( test_helper_.SetLoaderForURL(
...@@ -1171,26 +1178,6 @@ TEST_F(ViewManagerTest, CantGetViewTreeOfOtherRoots) { ...@@ -1171,26 +1178,6 @@ TEST_F(ViewManagerTest, CantGetViewTreeOfOtherRoots) {
EXPECT_EQ("view=1,1 parent=null", views[0].ToString()); EXPECT_EQ("view=1,1 parent=null", views[0].ToString());
} }
TEST_F(ViewManagerTest, ConnectTwice) {
ASSERT_TRUE(connection_->CreateView(BuildViewId(1, 1)));
ASSERT_TRUE(connection_->CreateView(BuildViewId(1, 2)));
ASSERT_NO_FATAL_FAILURE(EstablishSecondConnection(false));
// Try to connect again to 1,1, this should fail as already connected to that
// root.
ASSERT_TRUE(connection_->Embed(BuildViewId(1, 1), kTestServiceURL));
// Connecting to 1,2 should succeed and end up in connection2.
{
ASSERT_TRUE(connection_->Embed(BuildViewId(1, 2), kTestServiceURL));
connection2_->DoRunLoopUntilChangesCount(1);
const Changes changes(ChangesToDescription1(connection2_->changes()));
ASSERT_EQ(1u, changes.size());
EXPECT_EQ("ViewDeleted view=1,1", changes[0]);
}
}
TEST_F(ViewManagerTest, OnViewInput) { TEST_F(ViewManagerTest, OnViewInput) {
ASSERT_TRUE(connection_->CreateView(BuildViewId(1, 1))); ASSERT_TRUE(connection_->CreateView(BuildViewId(1, 1)));
ASSERT_NO_FATAL_FAILURE(EstablishSecondConnection(false)); ASSERT_NO_FATAL_FAILURE(EstablishSecondConnection(false));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment