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 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
394 compromised_renderer->GetProcess()->GetChannel(), evil); | 394 compromised_renderer->GetProcess()->GetChannel(), evil); |
395 | 395 |
396 ASSERT_TRUE(message_queue.WaitForMessage(&message)); | 396 ASSERT_TRUE(message_queue.WaitForMessage(&message)); |
397 ASSERT_EQ("evil", message) | 397 ASSERT_EQ("evil", message) |
398 << "Automation message should be received by WebContents."; | 398 << "Automation message should be received by WebContents."; |
399 ASSERT_EQ("\"okay\"", interstitial->last_command()) | 399 ASSERT_EQ("\"okay\"", interstitial->last_command()) |
400 << "Interstitial should not be affected."; | 400 << "Interstitial should not be affected."; |
401 | 401 |
402 // Send a second message from the interstitial page, and make sure that the | 402 // Send a second message from the interstitial page, and make sure that the |
403 // "evil" message doesn't arrive in the intervening period. | 403 // "evil" message doesn't arrive in the intervening period. |
404 ASSERT_TRUE(ExecuteScript(interstitial_page->GetMainFrame(), | 404 ExecuteUnmodifiedScript(interstitial_page->GetMainFrame(), |
405 "window.domAutomationController.send(\"okay2\");")); | 405 "window.domAutomationController.send(\"okay2\");"); |
406 ASSERT_TRUE(message_queue.WaitForMessage(&message)); | 406 ASSERT_TRUE(message_queue.WaitForMessage(&message)); |
407 ASSERT_EQ("\"okay2\"", message); | 407 ASSERT_EQ("\"okay2\"", message); |
408 ASSERT_EQ("\"okay2\"", interstitial->last_command()); | 408 ASSERT_EQ("\"okay2\"", interstitial->last_command()); |
409 } | 409 } |
410 | 410 |
411 // Intercepts the HTTP origin header and on being invoked once it is found | 411 // Intercepts the HTTP origin header and on being invoked once it is found |
412 // aborts the requeest. | 412 // aborts the requeest. |
413 void OnHttpHeaderReceived(const std::string& header, | 413 void OnHttpHeaderReceived(const std::string& header, |
414 const std::string& value, | 414 const std::string& value, |
415 int child_process_id, | 415 int child_process_id, |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
607 // |target_url|. | 607 // |target_url|. |
608 WaitForLoadStop(shell()->web_contents()); | 608 WaitForLoadStop(shell()->web_contents()); |
609 EXPECT_EQ(start_url, root->current_frame_host()->GetLastCommittedURL()); | 609 EXPECT_EQ(start_url, root->current_frame_host()->GetLastCommittedURL()); |
610 | 610 |
611 // Verify that the malicious renderer got killed. | 611 // Verify that the malicious renderer got killed. |
612 exit_observer.Wait(); | 612 exit_observer.Wait(); |
613 EXPECT_FALSE(exit_observer.did_exit_normally()); | 613 EXPECT_FALSE(exit_observer.did_exit_normally()); |
614 } | 614 } |
615 | 615 |
616 } // namespace content | 616 } // namespace content |
OLD | NEW |