| 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 569 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 580 TestJavaScriptDialogManager dialog_manager; | 580 TestJavaScriptDialogManager dialog_manager; |
| 581 shell()->web_contents()->SetDelegate(&dialog_manager); | 581 shell()->web_contents()->SetDelegate(&dialog_manager); |
| 582 SendCommand("Page.enable", nullptr, true); | 582 SendCommand("Page.enable", nullptr, true); |
| 583 std::unique_ptr<base::DictionaryValue> params(new base::DictionaryValue()); | 583 std::unique_ptr<base::DictionaryValue> params(new base::DictionaryValue()); |
| 584 params->SetString("expression", "alert('alert')"); | 584 params->SetString("expression", "alert('alert')"); |
| 585 SendCommand("Runtime.evaluate", std::move(params), false); | 585 SendCommand("Runtime.evaluate", std::move(params), false); |
| 586 WaitForNotification("Page.javascriptDialogOpening"); | 586 WaitForNotification("Page.javascriptDialogOpening"); |
| 587 dialog_manager.Handle(); | 587 dialog_manager.Handle(); |
| 588 } | 588 } |
| 589 | 589 |
| 590 IN_PROC_BROWSER_TEST_F(DevToolsProtocolTest, BrowserNewPage) { | 590 IN_PROC_BROWSER_TEST_F(DevToolsProtocolTest, BrowserCreateTarget) { |
| 591 NavigateToURLBlockUntilNavigationsComplete(shell(), GURL("about:blank"), 1); | 591 NavigateToURLBlockUntilNavigationsComplete(shell(), GURL("about:blank"), 1); |
| 592 Attach(); | 592 Attach(); |
| 593 EXPECT_EQ(1u, shell()->windows().size()); | 593 EXPECT_EQ(1u, shell()->windows().size()); |
| 594 std::unique_ptr<base::DictionaryValue> params(new base::DictionaryValue()); | 594 std::unique_ptr<base::DictionaryValue> params(new base::DictionaryValue()); |
| 595 params->SetString("initialUrl", "about:blank"); | 595 params->SetString("url", "about:blank"); |
| 596 SendCommand("Browser.newPage", std::move(params), true); | 596 SendCommand("Browser.createTarget", std::move(params), true); |
| 597 EXPECT_EQ(2u, shell()->windows().size()); | 597 EXPECT_EQ(2u, shell()->windows().size()); |
| 598 } | 598 } |
| 599 | 599 |
| 600 } // namespace content | 600 } // namespace content |
| OLD | NEW |