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

Side by Side Diff: components/html_viewer/ax_provider_apptest.cc

Issue 1340983002: Mandoline UI Process: Update namespaces and file names (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updated all the namespaces in mus 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "base/bind.h" 5 #include "base/bind.h"
6 #include "base/command_line.h" 6 #include "base/command_line.h"
7 #include "base/run_loop.h" 7 #include "base/run_loop.h"
8 #include "base/strings/stringprintf.h" 8 #include "base/strings/stringprintf.h"
9 #include "base/test/test_timeouts.h" 9 #include "base/test/test_timeouts.h"
10 #include "components/mus/public/cpp/tests/view_manager_test_base.h" 10 #include "components/mus/public/cpp/tests/mandoline_ui_services_test_base.h"
11 #include "components/mus/public/cpp/view.h" 11 #include "components/mus/public/cpp/view.h"
12 #include "components/mus/public/cpp/view_tree_connection.h" 12 #include "components/mus/public/cpp/view_tree_connection.h"
13 #include "components/web_view/public/interfaces/frame_tree.mojom.h" 13 #include "components/web_view/public/interfaces/frame_tree.mojom.h"
14 #include "mojo/application/public/cpp/application_impl.h" 14 #include "mojo/application/public/cpp/application_impl.h"
15 #include "mojo/application/public/cpp/application_test_base.h" 15 #include "mojo/application/public/cpp/application_test_base.h"
16 #include "net/test/spawned_test_server/spawned_test_server.h" 16 #include "net/test/spawned_test_server/spawned_test_server.h"
17 #include "testing/gtest/include/gtest/gtest.h" 17 #include "testing/gtest/include/gtest/gtest.h"
18 #include "third_party/mojo_services/src/accessibility/public/interfaces/accessib ility.mojom.h" 18 #include "third_party/mojo_services/src/accessibility/public/interfaces/accessib ility.mojom.h"
19 19
20 namespace mojo { 20 namespace mojo {
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 mojo::URLRequestPtr request) override {} 55 mojo::URLRequestPtr request) override {}
56 void DidNavigateLocally(uint32_t frame_id, const mojo::String& url) override { 56 void DidNavigateLocally(uint32_t frame_id, const mojo::String& url) override {
57 } 57 }
58 58
59 private: 59 private:
60 DISALLOW_COPY_AND_ASSIGN(TestFrameTreeServer); 60 DISALLOW_COPY_AND_ASSIGN(TestFrameTreeServer);
61 }; 61 };
62 62
63 } // namespace 63 } // namespace
64 64
65 using AXProviderTest = ViewManagerTestBase; 65 using AXProviderTest = mus::MandolineUIServicesTestBase;
66 66
67 TEST_F(AXProviderTest, HelloWorld) { 67 TEST_F(AXProviderTest, HelloWorld) {
68 // Start a test server for net/data/test.html access. 68 // Start a test server for net/data/test.html access.
69 net::SpawnedTestServer server( 69 net::SpawnedTestServer server(
70 net::SpawnedTestServer::TYPE_HTTP, net::SpawnedTestServer::kLocalhost, 70 net::SpawnedTestServer::TYPE_HTTP, net::SpawnedTestServer::kLocalhost,
71 base::FilePath(FILE_PATH_LITERAL("net/data"))); 71 base::FilePath(FILE_PATH_LITERAL("net/data")));
72 ASSERT_TRUE(server.Start()); 72 ASSERT_TRUE(server.Start());
73 73
74 // Connect to the URL through the mojo:html_viewer content handler. 74 // Connect to the URL through the mojo:html_viewer content handler.
75 const uint16_t assigned_port = server.host_port_pair().port(); 75 const uint16_t assigned_port = server.host_port_pair().port();
76 mojo::URLRequestPtr request(mojo::URLRequest::New()); 76 mojo::URLRequestPtr request(mojo::URLRequest::New());
77 request->url = mojo::String::From( 77 request->url = mojo::String::From(
78 base::StringPrintf("http://127.0.0.1:%u/files/test.html", assigned_port)); 78 base::StringPrintf("http://127.0.0.1:%u/files/test.html", assigned_port));
79 scoped_ptr<ApplicationConnection> connection = 79 scoped_ptr<ApplicationConnection> connection =
80 application_impl()->ConnectToApplication(request.Pass()); 80 application_impl()->ConnectToApplication(request.Pass());
81 81
82 // Embed the html_viewer in a View. 82 // Embed the html_viewer in a View.
83 ViewTreeClientPtr tree_client; 83 ViewTreeClientPtr tree_client;
84 connection->ConnectToService(&tree_client); 84 connection->ConnectToService(&tree_client);
85 View* embed_view = window_manager()->CreateView(); 85 mus::View* embed_view = window_manager()->CreateView();
86 embed_view->Embed(tree_client.Pass()); 86 embed_view->Embed(tree_client.Pass());
87 87
88 TestFrameTreeServer frame_tree_server; 88 TestFrameTreeServer frame_tree_server;
89 web_view::FrameTreeServerPtr frame_tree_server_ptr; 89 web_view::FrameTreeServerPtr frame_tree_server_ptr;
90 mojo::Binding<web_view::FrameTreeServer> frame_tree_server_binding( 90 mojo::Binding<web_view::FrameTreeServer> frame_tree_server_binding(
91 &frame_tree_server); 91 &frame_tree_server);
92 frame_tree_server_binding.Bind(GetProxy(&frame_tree_server_ptr).Pass()); 92 frame_tree_server_binding.Bind(GetProxy(&frame_tree_server_ptr).Pass());
93 93
94 mojo::Array<web_view::FrameDataPtr> array(1u); 94 mojo::Array<web_view::FrameDataPtr> array(1u);
95 array[0] = web_view::FrameData::New().Pass(); 95 array[0] = web_view::FrameData::New().Pass();
(...skipping 15 matching lines...) Expand all
111 EXPECT_TRUE(QuitRunLoop()); 111 EXPECT_TRUE(QuitRunLoop());
112 }); 112 });
113 ASSERT_TRUE(DoRunLoopWithTimeout()); 113 ASSERT_TRUE(DoRunLoopWithTimeout());
114 114
115 EXPECT_TRUE(AxTreeContainsText(ax_tree, "Hello ")); 115 EXPECT_TRUE(AxTreeContainsText(ax_tree, "Hello "));
116 EXPECT_TRUE(AxTreeContainsText(ax_tree, "World!")); 116 EXPECT_TRUE(AxTreeContainsText(ax_tree, "World!"));
117 EXPECT_FALSE(AxTreeContainsText(ax_tree, "foo")); 117 EXPECT_FALSE(AxTreeContainsText(ax_tree, "foo"));
118 } 118 }
119 119
120 } // namespace mojo 120 } // namespace mojo
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698