| 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 694 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 705 base::ListValue* target_infos; | 705 base::ListValue* target_infos; |
| 706 EXPECT_TRUE(result_->GetList("targetInfo", &target_infos)); | 706 EXPECT_TRUE(result_->GetList("targetInfo", &target_infos)); |
| 707 EXPECT_EQ(1u, target_infos->GetSize()); | 707 EXPECT_EQ(1u, target_infos->GetSize()); |
| 708 base::DictionaryValue* target_info; | 708 base::DictionaryValue* target_info; |
| 709 EXPECT_TRUE(target_infos->GetDictionary(0u, &target_info)); | 709 EXPECT_TRUE(target_infos->GetDictionary(0u, &target_info)); |
| 710 std::string target_id, type, title, url; | 710 std::string target_id, type, title, url; |
| 711 EXPECT_TRUE(target_info->GetString("targetId", &target_id)); | 711 EXPECT_TRUE(target_info->GetString("targetId", &target_id)); |
| 712 EXPECT_TRUE(target_info->GetString("type", &type)); | 712 EXPECT_TRUE(target_info->GetString("type", &type)); |
| 713 EXPECT_TRUE(target_info->GetString("title", &title)); | 713 EXPECT_TRUE(target_info->GetString("title", &title)); |
| 714 EXPECT_TRUE(target_info->GetString("url", &url)); | 714 EXPECT_TRUE(target_info->GetString("url", &url)); |
| 715 EXPECT_EQ(type, "page"); | 715 EXPECT_EQ(type, "web_contents"); |
| 716 EXPECT_EQ(title, "about:blank"); | 716 EXPECT_EQ(title, "about:blank"); |
| 717 EXPECT_EQ(url, "about:blank"); | 717 EXPECT_EQ(url, "about:blank"); |
| 718 } | 718 } |
| 719 | 719 |
| 720 namespace { | 720 namespace { |
| 721 class NavigationFinishedObserver : public content::WebContentsObserver { | 721 class NavigationFinishedObserver : public content::WebContentsObserver { |
| 722 public: | 722 public: |
| 723 explicit NavigationFinishedObserver(WebContents* web_contents) | 723 explicit NavigationFinishedObserver(WebContents* web_contents) |
| 724 : WebContentsObserver(web_contents), | 724 : WebContentsObserver(web_contents), |
| 725 num_finished_(0), | 725 num_finished_(0), |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 903 params->SetString("policy", "advance"); | 903 params->SetString("policy", "advance"); |
| 904 params->SetInteger("budget", 1000); | 904 params->SetInteger("budget", 1000); |
| 905 SendCommand("Emulation.setVirtualTimePolicy", std::move(params), true); | 905 SendCommand("Emulation.setVirtualTimePolicy", std::move(params), true); |
| 906 | 906 |
| 907 WaitForNotification("Emulation.virtualTimeBudgetExpired"); | 907 WaitForNotification("Emulation.virtualTimeBudgetExpired"); |
| 908 | 908 |
| 909 EXPECT_THAT(console_messages_, ElementsAre("before", "done", "after")); | 909 EXPECT_THAT(console_messages_, ElementsAre("before", "done", "after")); |
| 910 } | 910 } |
| 911 | 911 |
| 912 } // namespace content | 912 } // namespace content |
| OLD | NEW |