OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 <stddef.h> | 5 #include <stddef.h> |
6 #include <utility> | 6 #include <utility> |
7 | 7 |
8 #include "base/base64.h" | 8 #include "base/base64.h" |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
276 return url.ReplaceComponents(remove_port).spec(); | 276 return url.ReplaceComponents(remove_port).spec(); |
277 } | 277 } |
278 | 278 |
279 // Waits for the expected navigations to occur in any order. If an expected | 279 // Waits for the expected navigations to occur in any order. If an expected |
280 // navigation occurs, Page.processNavigation is called with the specified | 280 // navigation occurs, Page.processNavigation is called with the specified |
281 // navigation_response to either allow it to proceed or to cancel it. | 281 // navigation_response to either allow it to proceed or to cancel it. |
282 void ProcessNavigationsAnyOrder( | 282 void ProcessNavigationsAnyOrder( |
283 std::vector<ExpectedNavigation> expected_navigations) { | 283 std::vector<ExpectedNavigation> expected_navigations) { |
284 while (!expected_navigations.empty()) { | 284 while (!expected_navigations.empty()) { |
285 std::unique_ptr<base::DictionaryValue> params = | 285 std::unique_ptr<base::DictionaryValue> params = |
286 WaitForNotification("Page.navigationRequested", true); | 286 WaitForNotification("Page.navigationRequested"); |
287 | 287 |
288 std::string url; | 288 std::string url; |
289 ASSERT_TRUE(params->GetString("url", &url)); | 289 ASSERT_TRUE(params->GetString("url", &url)); |
290 | 290 |
291 // The url will typically have a random port which we want to remove. | 291 // The url will typically have a random port which we want to remove. |
292 url = RemovePort(GURL(url)); | 292 url = RemovePort(GURL(url)); |
293 | 293 |
294 int navigation_id; | 294 int navigation_id; |
295 ASSERT_TRUE(params->GetInteger("navigationId", &navigation_id)); | 295 ASSERT_TRUE(params->GetInteger("navigationId", &navigation_id)); |
296 bool is_in_main_frame; | 296 bool is_in_main_frame; |
(...skipping 1467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1764 EXPECT_EQ("polyglottal", value); | 1764 EXPECT_EQ("polyglottal", value); |
1765 found++; | 1765 found++; |
1766 } else { | 1766 } else { |
1767 FAIL(); | 1767 FAIL(); |
1768 } | 1768 } |
1769 } | 1769 } |
1770 EXPECT_EQ(2u, found); | 1770 EXPECT_EQ(2u, found); |
1771 } | 1771 } |
1772 | 1772 |
1773 } // namespace content | 1773 } // namespace content |
OLD | NEW |