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