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

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

Issue 1391963004: Correctly record and pass around navigation start time. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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 "base/time/time.h"
10 #include "components/mus/public/cpp/tests/view_manager_test_base.h" 11 #include "components/mus/public/cpp/tests/view_manager_test_base.h"
11 #include "components/mus/public/cpp/view.h" 12 #include "components/mus/public/cpp/view.h"
12 #include "components/mus/public/cpp/view_tree_connection.h" 13 #include "components/mus/public/cpp/view_tree_connection.h"
13 #include "components/web_view/public/interfaces/frame.mojom.h" 14 #include "components/web_view/public/interfaces/frame.mojom.h"
14 #include "mojo/application/public/cpp/application_impl.h" 15 #include "mojo/application/public/cpp/application_impl.h"
15 #include "mojo/application/public/cpp/application_test_base.h" 16 #include "mojo/application/public/cpp/application_test_base.h"
16 #include "net/test/spawned_test_server/spawned_test_server.h" 17 #include "net/test/spawned_test_server/spawned_test_server.h"
17 #include "testing/gtest/include/gtest/gtest.h" 18 #include "testing/gtest/include/gtest/gtest.h"
18 #include "third_party/mojo_services/src/accessibility/public/interfaces/accessib ility.mojom.h" 19 #include "third_party/mojo_services/src/accessibility/public/interfaces/accessib ility.mojom.h"
19 20
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 98
98 mojo::Array<web_view::mojom::FrameDataPtr> array(1u); 99 mojo::Array<web_view::mojom::FrameDataPtr> array(1u);
99 array[0] = web_view::mojom::FrameData::New().Pass(); 100 array[0] = web_view::mojom::FrameData::New().Pass();
100 array[0]->frame_id = embed_view->id(); 101 array[0]->frame_id = embed_view->id();
101 array[0]->parent_id = 0u; 102 array[0]->parent_id = 0u;
102 103
103 web_view::mojom::FrameClientPtr frame_client; 104 web_view::mojom::FrameClientPtr frame_client;
104 connection->ConnectToService(&frame_client); 105 connection->ConnectToService(&frame_client);
105 frame_client->OnConnect(frame_ptr.Pass(), 1u, embed_view->id(), 106 frame_client->OnConnect(frame_ptr.Pass(), 1u, embed_view->id(),
106 web_view::mojom::VIEW_CONNECT_TYPE_USE_NEW, 107 web_view::mojom::VIEW_CONNECT_TYPE_USE_NEW,
107 array.Pass(), base::Closure()); 108 array.Pass(),
109 base::TimeTicks::Now().ToInternalValue(),
110 base::Closure());
108 111
109 // Connect to the AxProvider of the HTML document and get the AxTree. 112 // Connect to the AxProvider of the HTML document and get the AxTree.
110 AxProviderPtr ax_provider; 113 AxProviderPtr ax_provider;
111 connection->ConnectToService(&ax_provider); 114 connection->ConnectToService(&ax_provider);
112 Array<AxNodePtr> ax_tree; 115 Array<AxNodePtr> ax_tree;
113 ax_provider->GetTree([&ax_tree](Array<AxNodePtr> tree) { 116 ax_provider->GetTree([&ax_tree](Array<AxNodePtr> tree) {
114 ax_tree = tree.Pass(); 117 ax_tree = tree.Pass();
115 EXPECT_TRUE(QuitRunLoop()); 118 EXPECT_TRUE(QuitRunLoop());
116 }); 119 });
117 ASSERT_TRUE(DoRunLoopWithTimeout()); 120 ASSERT_TRUE(DoRunLoopWithTimeout());
118 121
119 EXPECT_TRUE(AxTreeContainsText(ax_tree, "Hello ")); 122 EXPECT_TRUE(AxTreeContainsText(ax_tree, "Hello "));
120 EXPECT_TRUE(AxTreeContainsText(ax_tree, "World!")); 123 EXPECT_TRUE(AxTreeContainsText(ax_tree, "World!"));
121 EXPECT_FALSE(AxTreeContainsText(ax_tree, "foo")); 124 EXPECT_FALSE(AxTreeContainsText(ax_tree, "foo"));
122 } 125 }
123 126
124 } // namespace mojo 127 } // namespace mojo
OLDNEW
« no previous file with comments | « no previous file | components/html_viewer/document_resource_waiter.h » ('j') | components/web_view/navigation_entry.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698