| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 <stdint.h> | 5 #include <stdint.h> |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/containers/hash_tables.h" | 8 #include "base/containers/hash_tables.h" |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| (...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 343 interstitial->Show(); | 343 interstitial->Show(); |
| 344 } | 344 } |
| 345 | 345 |
| 346 // InterstitialPageDelegate implementation. | 346 // InterstitialPageDelegate implementation. |
| 347 void CommandReceived(const std::string& command) override { | 347 void CommandReceived(const std::string& command) override { |
| 348 last_command_ = command; | 348 last_command_ = command; |
| 349 } | 349 } |
| 350 | 350 |
| 351 std::string GetHTMLContents() override { | 351 std::string GetHTMLContents() override { |
| 352 return "<html><head><script>" | 352 return "<html><head><script>" |
| 353 "window.domAutomationController.setAutomationId(1);" | |
| 354 "window.domAutomationController.send(\"okay\");" | 353 "window.domAutomationController.send(\"okay\");" |
| 355 "</script></head>" | 354 "</script></head>" |
| 356 "<body>this page is an interstitial</body></html>"; | 355 "<body>this page is an interstitial</body></html>"; |
| 357 } | 356 } |
| 358 | 357 |
| 359 std::string last_command() { return last_command_; } | 358 std::string last_command() { return last_command_; } |
| 360 | 359 |
| 361 private: | 360 private: |
| 362 std::string last_command_; | 361 std::string last_command_; |
| 363 DISALLOW_COPY_AND_ASSIGN(SecurityExploitTestInterstitialPage); | 362 DISALLOW_COPY_AND_ASSIGN(SecurityExploitTestInterstitialPage); |
| (...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 634 // |target_url|. | 633 // |target_url|. |
| 635 WaitForLoadStop(shell()->web_contents()); | 634 WaitForLoadStop(shell()->web_contents()); |
| 636 EXPECT_EQ(start_url, root->current_frame_host()->GetLastCommittedURL()); | 635 EXPECT_EQ(start_url, root->current_frame_host()->GetLastCommittedURL()); |
| 637 | 636 |
| 638 // Verify that the malicious renderer got killed. | 637 // Verify that the malicious renderer got killed. |
| 639 exit_observer.Wait(); | 638 exit_observer.Wait(); |
| 640 EXPECT_FALSE(exit_observer.did_exit_normally()); | 639 EXPECT_FALSE(exit_observer.did_exit_normally()); |
| 641 } | 640 } |
| 642 | 641 |
| 643 } // namespace content | 642 } // namespace content |
| OLD | NEW |