| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "base/command_line.h" | 5 #include "base/command_line.h" |
| 6 #include "chrome/browser/predictors/resource_prefetch_predictor.h" | 6 #include "chrome/browser/predictors/resource_prefetch_predictor.h" |
| 7 #include "chrome/browser/predictors/resource_prefetch_predictor_factory.h" | 7 #include "chrome/browser/predictors/resource_prefetch_predictor_factory.h" |
| 8 #include "chrome/browser/predictors/resource_prefetch_predictor_test_util.h" | 8 #include "chrome/browser/predictors/resource_prefetch_predictor_test_util.h" |
| 9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
| 10 #include "chrome/browser/ui/browser.h" | 10 #include "chrome/browser/ui/browser.h" |
| (...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 449 AddExternalResource(GetURL(kScriptDocumentWritePath), | 449 AddExternalResource(GetURL(kScriptDocumentWritePath), |
| 450 content::RESOURCE_TYPE_SCRIPT, net::MEDIUM); | 450 content::RESOURCE_TYPE_SCRIPT, net::MEDIUM); |
| 451 externalScript->request.mime_type = kJavascriptMime; | 451 externalScript->request.mime_type = kJavascriptMime; |
| 452 AddResource(GetURL(kImagePath), content::RESOURCE_TYPE_IMAGE, net::LOWEST); | 452 AddResource(GetURL(kImagePath), content::RESOURCE_TYPE_IMAGE, net::LOWEST); |
| 453 AddResource(GetURL(kStylePath), content::RESOURCE_TYPE_STYLESHEET, | 453 AddResource(GetURL(kStylePath), content::RESOURCE_TYPE_STYLESHEET, |
| 454 net::HIGHEST); | 454 net::HIGHEST); |
| 455 AddResource(GetURL(kScriptPath), content::RESOURCE_TYPE_SCRIPT, net::MEDIUM); | 455 AddResource(GetURL(kScriptPath), content::RESOURCE_TYPE_SCRIPT, net::MEDIUM); |
| 456 NavigateToURLAndCheckSubresources(GetURL(kHtmlDocumentWritePath)); | 456 NavigateToURLAndCheckSubresources(GetURL(kHtmlDocumentWritePath)); |
| 457 } | 457 } |
| 458 | 458 |
| 459 // Disabled due to flakiness (crbug.com/673028). |
| 459 IN_PROC_BROWSER_TEST_F(ResourcePrefetchPredictorBrowserTest, | 460 IN_PROC_BROWSER_TEST_F(ResourcePrefetchPredictorBrowserTest, |
| 460 LearningJavascriptAppendChild) { | 461 DISABLED_LearningJavascriptAppendChild) { |
| 461 auto externalScript = | 462 auto externalScript = |
| 462 AddExternalResource(GetURL(kScriptAppendChildPath), | 463 AddExternalResource(GetURL(kScriptAppendChildPath), |
| 463 content::RESOURCE_TYPE_SCRIPT, net::MEDIUM); | 464 content::RESOURCE_TYPE_SCRIPT, net::MEDIUM); |
| 464 externalScript->request.mime_type = kJavascriptMime; | 465 externalScript->request.mime_type = kJavascriptMime; |
| 465 AddResource(GetURL(kImagePath), content::RESOURCE_TYPE_IMAGE, net::LOWEST); | 466 AddResource(GetURL(kImagePath), content::RESOURCE_TYPE_IMAGE, net::LOWEST); |
| 466 AddResource(GetURL(kStylePath), content::RESOURCE_TYPE_STYLESHEET, | 467 AddResource(GetURL(kStylePath), content::RESOURCE_TYPE_STYLESHEET, |
| 467 net::HIGHEST); | 468 net::HIGHEST); |
| 468 // This script has net::LOWEST priority because it's executed asynchronously. | 469 // This script has net::LOWEST priority because it's executed asynchronously. |
| 469 AddResource(GetURL(kScriptPath), content::RESOURCE_TYPE_SCRIPT, net::LOWEST); | 470 AddResource(GetURL(kScriptPath), content::RESOURCE_TYPE_SCRIPT, net::LOWEST); |
| 470 NavigateToURLAndCheckSubresources(GetURL(kHtmlAppendChildPath)); | 471 NavigateToURLAndCheckSubresources(GetURL(kHtmlAppendChildPath)); |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 511 AddResource(GetURL(kStylePath2), content::RESOURCE_TYPE_STYLESHEET, | 512 AddResource(GetURL(kStylePath2), content::RESOURCE_TYPE_STYLESHEET, |
| 512 net::HIGHEST); | 513 net::HIGHEST); |
| 513 AddResource(GetURL(kScriptPath2), content::RESOURCE_TYPE_SCRIPT, net::MEDIUM); | 514 AddResource(GetURL(kScriptPath2), content::RESOURCE_TYPE_SCRIPT, net::MEDIUM); |
| 514 // Included from <iframe src="html_subresources.html"> and not recored. | 515 // Included from <iframe src="html_subresources.html"> and not recored. |
| 515 AddUnrecordedResources({GetURL(kImagePath), GetURL(kStylePath), | 516 AddUnrecordedResources({GetURL(kImagePath), GetURL(kStylePath), |
| 516 GetURL(kScriptPath), GetURL(kFontPath)}); | 517 GetURL(kScriptPath), GetURL(kFontPath)}); |
| 517 NavigateToURLAndCheckSubresources(GetURL(kHtmlIframePath)); | 518 NavigateToURLAndCheckSubresources(GetURL(kHtmlIframePath)); |
| 518 } | 519 } |
| 519 | 520 |
| 520 } // namespace predictors | 521 } // namespace predictors |
| OLD | NEW |