| 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 "components/dom_distiller/content/browser/distiller_page_web_contents.h
" | 5 #include "components/dom_distiller/content/browser/distiller_page_web_contents.h
" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
| 10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
| (...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 243 shell()->web_contents()->GetContainerBounds().size(), | 243 shell()->web_contents()->GetContainerBounds().size(), |
| 244 scoped_ptr<SourcePageHandleWebContents>()); | 244 scoped_ptr<SourcePageHandleWebContents>()); |
| 245 distiller_page_ = &distiller_page; | 245 distiller_page_ = &distiller_page; |
| 246 | 246 |
| 247 base::RunLoop run_loop; | 247 base::RunLoop run_loop; |
| 248 DistillPage(run_loop.QuitClosure(), kVideoArticlePath); | 248 DistillPage(run_loop.QuitClosure(), kVideoArticlePath); |
| 249 run_loop.Run(); | 249 run_loop.Run(); |
| 250 | 250 |
| 251 // A relative source/track should've been updated. | 251 // A relative source/track should've been updated. |
| 252 EXPECT_THAT(distiller_result_->distilled_content().html(), | 252 EXPECT_THAT(distiller_result_->distilled_content().html(), |
| 253 ContainsRegex("src=\"http://127.0.0.1:.*/relative_video.webm\"")); | 253 ContainsRegex("src=\"http://127.0.0.1:.*/relative_video.mp4\"")); |
| 254 EXPECT_THAT( | 254 EXPECT_THAT( |
| 255 distiller_result_->distilled_content().html(), | 255 distiller_result_->distilled_content().html(), |
| 256 ContainsRegex("src=\"http://127.0.0.1:.*/relative_track_en.vtt\"")); | 256 ContainsRegex("src=\"http://127.0.0.1:.*/relative_track_en.vtt\"")); |
| 257 EXPECT_THAT(distiller_result_->distilled_content().html(), | 257 EXPECT_THAT(distiller_result_->distilled_content().html(), |
| 258 HasSubstr("src=\"http://www.google.com/absolute_video.ogg\"")); | 258 HasSubstr("src=\"http://www.google.com/absolute_video.ogg\"")); |
| 259 EXPECT_THAT(distiller_result_->distilled_content().html(), | 259 EXPECT_THAT(distiller_result_->distilled_content().html(), |
| 260 HasSubstr("src=\"http://www.google.com/absolute_track_fr.vtt\"")); | 260 HasSubstr("src=\"http://www.google.com/absolute_track_fr.vtt\"")); |
| 261 } | 261 } |
| 262 | 262 |
| 263 IN_PROC_BROWSER_TEST_F(DistillerPageWebContentsTest, VisibilityDetection) { | 263 IN_PROC_BROWSER_TEST_F(DistillerPageWebContentsTest, VisibilityDetection) { |
| (...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 517 ASSERT_TRUE(js_result_); | 517 ASSERT_TRUE(js_result_); |
| 518 ASSERT_TRUE(js_result_->GetAsDictionary(&dict)); | 518 ASSERT_TRUE(js_result_->GetAsDictionary(&dict)); |
| 519 | 519 |
| 520 ASSERT_TRUE(dict->HasKey("success")); | 520 ASSERT_TRUE(dict->HasKey("success")); |
| 521 bool success; | 521 bool success; |
| 522 ASSERT_TRUE(dict->GetBoolean("success", &success)); | 522 ASSERT_TRUE(dict->GetBoolean("success", &success)); |
| 523 EXPECT_TRUE(success); | 523 EXPECT_TRUE(success); |
| 524 } | 524 } |
| 525 | 525 |
| 526 } // namespace dom_distiller | 526 } // namespace dom_distiller |
| OLD | NEW |