| 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/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/json/json_reader.h" | 10 #include "base/json/json_reader.h" |
| (...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 337 IN_PROC_BROWSER_TEST_F(DevToolsProtocolTest, NavigationPreservesMessages) { | 337 IN_PROC_BROWSER_TEST_F(DevToolsProtocolTest, NavigationPreservesMessages) { |
| 338 ASSERT_TRUE(embedded_test_server()->Start()); | 338 ASSERT_TRUE(embedded_test_server()->Start()); |
| 339 GURL test_url = embedded_test_server()->GetURL("/devtools/navigation.html"); | 339 GURL test_url = embedded_test_server()->GetURL("/devtools/navigation.html"); |
| 340 NavigateToURLBlockUntilNavigationsComplete(shell(), test_url, 1); | 340 NavigateToURLBlockUntilNavigationsComplete(shell(), test_url, 1); |
| 341 Attach(); | 341 Attach(); |
| 342 SendCommand("Page.enable", nullptr, false); | 342 SendCommand("Page.enable", nullptr, false); |
| 343 | 343 |
| 344 scoped_ptr<base::DictionaryValue> params(new base::DictionaryValue()); | 344 scoped_ptr<base::DictionaryValue> params(new base::DictionaryValue()); |
| 345 test_url = GetTestUrl("devtools", "navigation.html"); | 345 test_url = GetTestUrl("devtools", "navigation.html"); |
| 346 params->SetString("url", test_url.spec()); | 346 params->SetString("url", test_url.spec()); |
| 347 TestNavigationObserver navigation_observer(shell()->web_contents()); |
| 347 SendCommand("Page.navigate", std::move(params), true); | 348 SendCommand("Page.navigate", std::move(params), true); |
| 349 navigation_observer.Wait(); |
| 348 | 350 |
| 349 bool enough_results = result_ids_.size() >= 2u; | 351 bool enough_results = result_ids_.size() >= 2u; |
| 350 EXPECT_TRUE(enough_results); | 352 EXPECT_TRUE(enough_results); |
| 351 if (enough_results) { | 353 if (enough_results) { |
| 352 EXPECT_EQ(1, result_ids_[0]); // Page.enable | 354 EXPECT_EQ(1, result_ids_[0]); // Page.enable |
| 353 EXPECT_EQ(2, result_ids_[1]); // Page.navigate | 355 EXPECT_EQ(2, result_ids_[1]); // Page.navigate |
| 354 } | 356 } |
| 355 | 357 |
| 356 enough_results = notifications_.size() >= 1u; | 358 enough_results = notifications_.size() >= 1u; |
| 357 EXPECT_TRUE(enough_results); | 359 EXPECT_TRUE(enough_results); |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 480 GURL("javascript:x=1"), | 482 GURL("javascript:x=1"), |
| 481 nullptr, | 483 nullptr, |
| 482 gfx::Size()); | 484 gfx::Size()); |
| 483 WaitForLoadStop(window->web_contents()); | 485 WaitForLoadStop(window->web_contents()); |
| 484 Attach(); | 486 Attach(); |
| 485 SendCommand("Page.reload", nullptr, false); | 487 SendCommand("Page.reload", nullptr, false); |
| 486 // Should not crash at this point. | 488 // Should not crash at this point. |
| 487 } | 489 } |
| 488 | 490 |
| 489 } // namespace content | 491 } // namespace content |
| OLD | NEW |