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

Unified Diff: mojo/shell/tests/shell/shell_unittest.cc

Issue 1764253002: Rename shell.mojom to connector.mojom, ApplicationManager to Shell (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@32exe
Patch Set: . Created 4 years, 10 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 | « mojo/shell/tests/shell/driver_manifest.json ('k') | mojo/shell/tests/shell/shell_unittest.mojom » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/shell/tests/shell/shell_unittest.cc
diff --git a/mojo/shell/tests/application_manager/application_manager_unittest.cc b/mojo/shell/tests/shell/shell_unittest.cc
similarity index 70%
rename from mojo/shell/tests/application_manager/application_manager_unittest.cc
rename to mojo/shell/tests/shell/shell_unittest.cc
index c4279aa6dedda88a51e9e2fdd33447798874c6a5..359da2cabcab5477357e6c744ea2a607a7333e29 100644
--- a/mojo/shell/tests/application_manager/application_manager_unittest.cc
+++ b/mojo/shell/tests/shell/shell_unittest.cc
@@ -15,41 +15,41 @@
#include "mojo/shell/public/cpp/interface_factory.h"
#include "mojo/shell/public/cpp/shell_client.h"
#include "mojo/shell/public/cpp/shell_test.h"
-#include "mojo/shell/public/interfaces/application_manager.mojom.h"
-#include "mojo/shell/tests/application_manager/application_manager_unittest.mojom.h"
+#include "mojo/shell/public/interfaces/shell.mojom.h"
+#include "mojo/shell/tests/shell/shell_unittest.mojom.h"
namespace mojo {
namespace shell {
namespace {
-class ApplicationManagerTestClient
+class ShellTestClient
: public mojo::test::ShellTestClient,
- public InterfaceFactory<test::mojom::CreateInstanceForHandleTest>,
- public test::mojom::CreateInstanceForHandleTest {
+ public InterfaceFactory<test::mojom::CreateInstanceForFactoryTest>,
+ public test::mojom::CreateInstanceForFactoryTest {
public:
- explicit ApplicationManagerTestClient(mojo::test::ShellTest* test)
- : ShellTestClient(test),
+ explicit ShellTestClient(mojo::test::ShellTest* test)
+ : mojo::test::ShellTestClient(test),
target_id_(mojom::Connector::kInvalidApplicationID),
binding_(this) {}
- ~ApplicationManagerTestClient() override {}
+ ~ShellTestClient() override {}
uint32_t target_id() const { return target_id_; }
private:
// mojo::ShellClient:
bool AcceptConnection(Connection* connection) override {
- connection->AddInterface<test::mojom::CreateInstanceForHandleTest>(this);
+ connection->AddInterface<test::mojom::CreateInstanceForFactoryTest>(this);
return true;
}
- // InterfaceFactory<test::mojom::CreateInstanceForHandleTest>:
+ // InterfaceFactory<test::mojom::CreateInstanceForFactoryTest>:
void Create(
Connection* connection,
- test::mojom::CreateInstanceForHandleTestRequest request) override {
+ test::mojom::CreateInstanceForFactoryTestRequest request) override {
binding_.Bind(std::move(request));
}
- // test::mojom::CreateInstanceForHandleTest:
+ // test::mojom::CreateInstanceForFactoryTest:
void SetTargetID(uint32_t target_id) override {
target_id_ = target_id;
base::MessageLoop::current()->QuitWhenIdle();
@@ -57,21 +57,21 @@ class ApplicationManagerTestClient
uint32_t target_id_;
- Binding<test::mojom::CreateInstanceForHandleTest> binding_;
+ Binding<test::mojom::CreateInstanceForFactoryTest> binding_;
- DISALLOW_COPY_AND_ASSIGN(ApplicationManagerTestClient);
+ DISALLOW_COPY_AND_ASSIGN(ShellTestClient);
};
} // namespace
-class ApplicationManagerTest : public mojo::test::ShellTest,
- public mojom::InstanceListener {
+class ShellTest : public mojo::test::ShellTest,
+ public mojom::InstanceListener {
public:
- ApplicationManagerTest()
- : ShellTest("mojo:application_manager_unittest"),
+ ShellTest()
+ : mojo::test::ShellTest("mojo:shell_unittest"),
shell_client_(nullptr),
binding_(this) {}
- ~ApplicationManagerTest() override {}
+ ~ShellTest() override {}
void OnDriverQuit() {
base::MessageLoop::current()->QuitNow();
@@ -88,11 +88,10 @@ class ApplicationManagerTest : public mojo::test::ShellTest,
};
void AddListenerAndWaitForApplications() {
- mojom::ApplicationManagerPtr application_manager;
- connector()->ConnectToInterface("mojo:shell", &application_manager);
+ mojom::ShellPtr shell;
+ connector()->ConnectToInterface("mojo:shell", &shell);
- application_manager->AddInstanceListener(
- binding_.CreateInterfacePtrAndBind());
+ shell->AddInstanceListener(binding_.CreateInterfacePtrAndBind());
binding_.WaitForIncomingMethodCall();
}
@@ -120,7 +119,7 @@ class ApplicationManagerTest : public mojo::test::ShellTest,
private:
// test::ShellTest:
scoped_ptr<ShellClient> CreateShellClient() override {
- shell_client_ = new ApplicationManagerTestClient(this);
+ shell_client_ = new ShellTestClient(this);
return make_scoped_ptr(shell_client_);
}
@@ -152,26 +151,26 @@ class ApplicationManagerTest : public mojo::test::ShellTest,
}
}
- ApplicationManagerTestClient* shell_client_;
+ ShellTestClient* shell_client_;
Binding<mojom::InstanceListener> binding_;
std::vector<InstanceInfo> instances_;
std::vector<InstanceInfo> initial_instances_;
- DISALLOW_COPY_AND_ASSIGN(ApplicationManagerTest);
+ DISALLOW_COPY_AND_ASSIGN(ShellTest);
};
-TEST_F(ApplicationManagerTest, CreateInstanceForHandle) {
+TEST_F(ShellTest, CreateInstanceForFactory) {
AddListenerAndWaitForApplications();
// 1. Launch a process. (Actually, have the runner launch a process that
// launches a process.)
mojo::shell::test::mojom::DriverPtr driver;
scoped_ptr<Connection> connection =
- connector()->Connect("exe:application_manager_unittest_driver");
+ connector()->Connect("exe:shell_unittest_driver");
connection->GetInterface(&driver);
// 2. Wait for the target to connect to us. (via
- // mojo:application_manager_unittest)
+ // mojo:shell_unittest)
base::MessageLoop::current()->Run();
uint32_t remote_id = mojom::Connector::kInvalidApplicationID;
@@ -180,7 +179,7 @@ TEST_F(ApplicationManagerTest, CreateInstanceForHandle) {
// 3. Validate that this test suite's name was received from the application
// manager.
- EXPECT_TRUE(ContainsInstanceWithName("mojo:application_manager_unittest"));
+ EXPECT_TRUE(ContainsInstanceWithName("mojo:shell_unittest"));
// 4. Validate that the right applications/processes were created.
// Note that the target process will be created even if the tests are
@@ -189,19 +188,19 @@ TEST_F(ApplicationManagerTest, CreateInstanceForHandle) {
{
auto& instance = instances().front();
EXPECT_EQ(remote_id, instance.id);
- EXPECT_EQ("exe:application_manager_unittest_driver", instance.name);
+ EXPECT_EQ("exe:shell_unittest_driver", instance.name);
EXPECT_NE(base::kNullProcessId, instance.pid);
}
{
auto& instance = instances().back();
// We learn about the target process id via a ping from it.
EXPECT_EQ(target_id(), instance.id);
- EXPECT_EQ("exe:application_manager_unittest_target", instance.name);
+ EXPECT_EQ("exe:shell_unittest_target", instance.name);
EXPECT_NE(base::kNullProcessId, instance.pid);
}
driver.set_connection_error_handler(
- base::Bind(&ApplicationManagerTest::OnDriverQuit,
+ base::Bind(&ShellTest::OnDriverQuit,
base::Unretained(this)));
driver->QuitDriver();
base::MessageLoop::current()->Run();
« no previous file with comments | « mojo/shell/tests/shell/driver_manifest.json ('k') | mojo/shell/tests/shell/shell_unittest.mojom » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698