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