| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 <string> | 5 #include <string> |
| 6 #include <vector> | 6 #include <vector> |
| 7 | 7 |
| 8 #include "base/at_exit.h" | 8 #include "base/at_exit.h" |
| 9 #include "base/auto_reset.h" | 9 #include "base/auto_reset.h" |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 481 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 492 | 492 |
| 493 typedef std::vector<std::string> Changes; | 493 typedef std::vector<std::string> Changes; |
| 494 | 494 |
| 495 class ViewManagerTest : public testing::Test { | 495 class ViewManagerTest : public testing::Test { |
| 496 public: | 496 public: |
| 497 ViewManagerTest() | 497 ViewManagerTest() |
| 498 : connection_(NULL), | 498 : connection_(NULL), |
| 499 connection2_(NULL), | 499 connection2_(NULL), |
| 500 connection3_(NULL) {} | 500 connection3_(NULL) {} |
| 501 | 501 |
| 502 virtual void SetUp() override { | 502 void SetUp() override { |
| 503 ASSERT_TRUE(ViewManagerProxy::IsInInitialState()); | 503 ASSERT_TRUE(ViewManagerProxy::IsInInitialState()); |
| 504 test_helper_.Init(); | 504 test_helper_.Init(); |
| 505 std::vector<std::string> native_viewport_args; | 505 std::vector<std::string> native_viewport_args; |
| 506 native_viewport_args.push_back(kUseTestConfig); | 506 native_viewport_args.push_back(kUseTestConfig); |
| 507 test_helper_.application_manager()->SetArgsForURL( | 507 test_helper_.application_manager()->SetArgsForURL( |
| 508 native_viewport_args, GURL("mojo:native_viewport_service")); | 508 native_viewport_args, GURL("mojo:native_viewport_service")); |
| 509 printf("Setting args\n"); | 509 printf("Setting args\n"); |
| 510 | 510 |
| 511 #if defined(OS_WIN) | 511 #if defined(OS_WIN) |
| 512 // As we unload the wndproc of window classes we need to be sure to | 512 // As we unload the wndproc of window classes we need to be sure to |
| (...skipping 11 matching lines...) Expand all Loading... |
| 524 | 524 |
| 525 test_helper_.application_manager()->ConnectToService( | 525 test_helper_.application_manager()->ConnectToService( |
| 526 GURL("mojo:view_manager"), &view_manager_init_); | 526 GURL("mojo:view_manager"), &view_manager_init_); |
| 527 ASSERT_TRUE(InitEmbed(view_manager_init_.get(), kTestServiceURL, 1)); | 527 ASSERT_TRUE(InitEmbed(view_manager_init_.get(), kTestServiceURL, 1)); |
| 528 | 528 |
| 529 connection_ = ViewManagerProxy::WaitForInstance(); | 529 connection_ = ViewManagerProxy::WaitForInstance(); |
| 530 ASSERT_TRUE(connection_ != NULL); | 530 ASSERT_TRUE(connection_ != NULL); |
| 531 connection_->DoRunLoopUntilChangesCount(1); | 531 connection_->DoRunLoopUntilChangesCount(1); |
| 532 } | 532 } |
| 533 | 533 |
| 534 virtual void TearDown() override { | 534 void TearDown() override { |
| 535 if (connection3_) | 535 if (connection3_) |
| 536 connection3_->Destroy(); | 536 connection3_->Destroy(); |
| 537 if (connection2_) | 537 if (connection2_) |
| 538 connection2_->Destroy(); | 538 connection2_->Destroy(); |
| 539 if (connection_) | 539 if (connection_) |
| 540 connection_->Destroy(); | 540 connection_->Destroy(); |
| 541 } | 541 } |
| 542 | 542 |
| 543 protected: | 543 protected: |
| 544 void EstablishSecondConnectionWithRoot(Id root_id) { | 544 void EstablishSecondConnectionWithRoot(Id root_id) { |
| (...skipping 927 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1472 | 1472 |
| 1473 // TODO(sky): add coverage of test that destroys connections and ensures other | 1473 // TODO(sky): add coverage of test that destroys connections and ensures other |
| 1474 // connections get deletion notification. | 1474 // connections get deletion notification. |
| 1475 | 1475 |
| 1476 // TODO(sky): need to better track changes to initial connection. For example, | 1476 // TODO(sky): need to better track changes to initial connection. For example, |
| 1477 // that SetBounsdViews/AddView and the like don't result in messages to the | 1477 // that SetBounsdViews/AddView and the like don't result in messages to the |
| 1478 // originating connection. | 1478 // originating connection. |
| 1479 | 1479 |
| 1480 } // namespace service | 1480 } // namespace service |
| 1481 } // namespace mojo | 1481 } // namespace mojo |
| OLD | NEW |