| 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 701 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 712 base::ListValue* target_infos; | 712 base::ListValue* target_infos; |
| 713 EXPECT_TRUE(result_->GetList("targetInfo", &target_infos)); | 713 EXPECT_TRUE(result_->GetList("targetInfo", &target_infos)); |
| 714 EXPECT_EQ(1u, target_infos->GetSize()); | 714 EXPECT_EQ(1u, target_infos->GetSize()); |
| 715 base::DictionaryValue* target_info; | 715 base::DictionaryValue* target_info; |
| 716 EXPECT_TRUE(target_infos->GetDictionary(0u, &target_info)); | 716 EXPECT_TRUE(target_infos->GetDictionary(0u, &target_info)); |
| 717 std::string target_id, type, title, url; | 717 std::string target_id, type, title, url; |
| 718 EXPECT_TRUE(target_info->GetString("targetId", &target_id)); | 718 EXPECT_TRUE(target_info->GetString("targetId", &target_id)); |
| 719 EXPECT_TRUE(target_info->GetString("type", &type)); | 719 EXPECT_TRUE(target_info->GetString("type", &type)); |
| 720 EXPECT_TRUE(target_info->GetString("title", &title)); | 720 EXPECT_TRUE(target_info->GetString("title", &title)); |
| 721 EXPECT_TRUE(target_info->GetString("url", &url)); | 721 EXPECT_TRUE(target_info->GetString("url", &url)); |
| 722 EXPECT_EQ(type, "page"); | 722 EXPECT_EQ(type, "web_contents"); |
| 723 EXPECT_EQ(title, "about:blank"); | 723 EXPECT_EQ(title, "about:blank"); |
| 724 EXPECT_EQ(url, "about:blank"); | 724 EXPECT_EQ(url, "about:blank"); |
| 725 } | 725 } |
| 726 | 726 |
| 727 namespace { | 727 namespace { |
| 728 class NavigationFinishedObserver : public content::WebContentsObserver { | 728 class NavigationFinishedObserver : public content::WebContentsObserver { |
| 729 public: | 729 public: |
| 730 explicit NavigationFinishedObserver(WebContents* web_contents) | 730 explicit NavigationFinishedObserver(WebContents* web_contents) |
| 731 : WebContentsObserver(web_contents), | 731 : WebContentsObserver(web_contents), |
| 732 num_finished_(0), | 732 num_finished_(0), |
| (...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 931 params->SetString("policy", "advance"); | 931 params->SetString("policy", "advance"); |
| 932 params->SetInteger("budget", 1000); | 932 params->SetInteger("budget", 1000); |
| 933 SendCommand("Emulation.setVirtualTimePolicy", std::move(params), true); | 933 SendCommand("Emulation.setVirtualTimePolicy", std::move(params), true); |
| 934 | 934 |
| 935 WaitForNotification("Emulation.virtualTimeBudgetExpired"); | 935 WaitForNotification("Emulation.virtualTimeBudgetExpired"); |
| 936 | 936 |
| 937 EXPECT_THAT(console_messages_, ElementsAre("before", "done", "after")); | 937 EXPECT_THAT(console_messages_, ElementsAre("before", "done", "after")); |
| 938 } | 938 } |
| 939 | 939 |
| 940 } // namespace content | 940 } // namespace content |
| OLD | NEW |