OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/file_path.h" | 5 #include "base/file_path.h" |
6 #include "chrome/test/ui/ui_layout_test.h" | 6 #include "chrome/test/ui/ui_layout_test.h" |
7 | 7 |
8 class AppCacheUITest : public UILayoutTest { | 8 class AppCacheUITest : public UILayoutTest { |
| 9 public: |
| 10 void RunAppCacheTests(const char* tests[], int num_tests) { |
| 11 FilePath http_test_dir; |
| 12 http_test_dir = http_test_dir.AppendASCII("http"); |
| 13 http_test_dir = http_test_dir.AppendASCII("tests"); |
| 14 |
| 15 FilePath appcache_test_dir; |
| 16 appcache_test_dir = appcache_test_dir.AppendASCII("appcache"); |
| 17 InitializeForLayoutTest(http_test_dir, appcache_test_dir, kHttpPort); |
| 18 |
| 19 StartHttpServer(new_http_root_dir_); |
| 20 for (int i = 0; i < num_tests; ++i) |
| 21 RunLayoutTest(tests[i], kHttpPort); |
| 22 StopHttpServer(); |
| 23 } |
| 24 |
9 protected: | 25 protected: |
10 virtual ~AppCacheUITest() {} | 26 virtual ~AppCacheUITest() {} |
11 }; | 27 }; |
12 | 28 |
13 // Flaky: http://crbug.com/54717 | 29 // Flaky: http://crbug.com/54717 |
14 TEST_F(AppCacheUITest, FLAKY_AppCacheLayoutTests) { | 30 // The tests that don't depend on PHP should be less flaky. |
15 static const char* kLayoutTestFiles[] = { | 31 TEST_F(AppCacheUITest, FLAKY_AppCacheLayoutTests_NoPHP) { |
| 32 static const char* kNoPHPTests[] = { |
16 "404-manifest.html", | 33 "404-manifest.html", |
17 "404-resource.html", | 34 "404-resource.html", |
18 "auth.html", | |
19 "cyrillic-uri.html", | 35 "cyrillic-uri.html", |
20 "deferred-events-delete-while-raising.html", | 36 "deferred-events-delete-while-raising.html", |
21 "deferred-events.html", | 37 "deferred-events.html", |
22 "destroyed-frame.html", | 38 "destroyed-frame.html", |
23 "detached-iframe.html", | 39 "detached-iframe.html", |
24 "different-origin-manifest.html", | 40 "different-origin-manifest.html", |
25 "different-scheme.html", | 41 "different-scheme.html", |
26 "empty-manifest.html", | 42 "empty-manifest.html", |
27 "fallback.html", | |
28 "foreign-iframe-main.html", | 43 "foreign-iframe-main.html", |
29 "main-resource-hash.html", | 44 "insert-html-element-with-manifest.html", |
| 45 "insert-html-element-with-manifest-2.html", |
30 "manifest-containing-itself.html", | 46 "manifest-containing-itself.html", |
31 "manifest-parsing.html", | 47 "manifest-parsing.html", |
32 "manifest-redirect-2.html", | |
33 "manifest-redirect.html", | |
34 "manifest-with-empty-file.html", | 48 "manifest-with-empty-file.html", |
35 "navigating-away-while-cache-attempt-in-progress.html", | |
36 "offline-access.html", | |
37 "online-whitelist.html", | |
38 "progress-counter.html", | 49 "progress-counter.html", |
39 "reload.html", | 50 "reload.html", |
40 "remove-cache.html", | |
41 "resource-redirect-2.html", | |
42 "resource-redirect.html", | |
43 "simple.html", | 51 "simple.html", |
44 "top-frame-1.html", | 52 "top-frame-1.html", |
45 "top-frame-2.html", | 53 "top-frame-2.html", |
46 "top-frame-3.html", | 54 "top-frame-3.html", |
47 "top-frame-4.html", | 55 "top-frame-4.html", |
48 "whitelist-wildcard.html", | 56 "whitelist-wildcard.html", |
49 "wrong-content-type.html", | 57 "wrong-content-type.html", |
50 "wrong-signature-2.html", | 58 "wrong-signature-2.html", |
51 "wrong-signature.html", | 59 "wrong-signature.html", |
52 "xhr-foreign-resource.html", | 60 "xhr-foreign-resource.html", |
53 | |
54 // TODO(michaeln): investigate these more closely | |
55 // "crash-when-navigating-away-then-back.html", | |
56 // "credential-url.html", | |
57 // "different-https-origin-resource-main.html", | |
58 // "fail-on-update.html", | |
59 // "idempotent-update.html", not sure this is a valid test | |
60 // "local-content.html", | |
61 // "max-size.html", we use a different quota scheme | |
62 // "update-cache.html", bug 38006 | |
63 }; | 61 }; |
64 | 62 |
65 FilePath http_test_dir; | 63 // This test is racey. |
66 http_test_dir = http_test_dir.AppendASCII("http"); | 64 // https://bugs.webkit.org/show_bug.cgi?id=49104 |
67 http_test_dir = http_test_dir.AppendASCII("tests"); | 65 // "foreign-fallback.html" |
68 | 66 |
69 FilePath appcache_test_dir; | 67 RunAppCacheTests(kNoPHPTests, arraysize(kNoPHPTests)); |
70 appcache_test_dir = appcache_test_dir.AppendASCII("appcache"); | 68 } |
71 InitializeForLayoutTest(http_test_dir, appcache_test_dir, kHttpPort); | |
72 | 69 |
73 StartHttpServer(new_http_root_dir_); | 70 // Flaky: http://crbug.com/54717 |
74 for (size_t i = 0; i < arraysize(kLayoutTestFiles); ++i) | 71 // Lighty/PHP is not reliable enough on windows. |
75 RunLayoutTest(kLayoutTestFiles[i], kHttpPort); | 72 TEST_F(AppCacheUITest, FLAKY_AppCacheLayoutTests_PHP) { |
76 StopHttpServer(); | 73 static const char* kPHPTests[] = { |
| 74 "auth.html", |
| 75 "fallback.html", |
| 76 "main-resource-hash.html", |
| 77 "manifest-redirect.html", |
| 78 "manifest-redirect-2.html", |
| 79 "navigating-away-while-cache-attempt-in-progress.html", |
| 80 "non-html.xhtml", |
| 81 "offline-access.html", |
| 82 "online-whitelist.html", |
| 83 "resource-redirect.html", |
| 84 "resource-redirect-2.html", |
| 85 "update-cache.html", |
| 86 }; |
| 87 |
| 88 // These tests are racey due to status polling on timers. |
| 89 // https://bugs.webkit.org/show_bug.cgi?id=49104 |
| 90 // "fail-on-update.html", |
| 91 // "fail-on-update2.html", |
| 92 // "remove-cache.html", |
| 93 |
| 94 // TODO(michaeln): investigate these more closely |
| 95 // "crash-when-navigating-away-then-back.html", |
| 96 // "credential-url.html", |
| 97 // "different-https-origin-resource-main.html", |
| 98 // "idempotent-update.html", not sure this is a valid test |
| 99 // "local-content.html", |
| 100 // "max-size.html", we use a different quota scheme |
| 101 |
| 102 RunAppCacheTests(kPHPTests, arraysize(kPHPTests)); |
77 } | 103 } |
OLD | NEW |