Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "base/file_path.h" | |
| 6 #include "base/file_util.h" | |
| 7 #include "base/test/test_timeouts.h" | |
| 8 #include "chrome/test/automation/tab_proxy.h" | |
| 9 #include "chrome/test/base/ui_test_utils.h" | |
| 10 #include "chrome/test/ui/ui_layout_test.h" | |
| 11 #include "content/public/common/content_switches.h" | |
| 12 #include "net/base/net_util.h" | |
| 13 | |
| 14 static const char* kLayoutTestFileNames[] = { | |
| 15 // TODO(dgrogan): Put the other IDB layout tests here. | |
| 16 "prefetch-bugfix-108071.html", | |
| 17 NULL | |
| 18 }; | |
| 19 | |
| 20 class IndexedDBUILayoutTest : public UILayoutTest { | |
| 21 protected: | |
| 22 IndexedDBUILayoutTest() | |
| 23 : UILayoutTest(), | |
| 24 test_dir_(FilePath(). | |
| 25 AppendASCII("storage").AppendASCII("indexeddb")) { | |
| 26 } | |
| 27 | |
| 28 virtual ~IndexedDBUILayoutTest() { } | |
| 29 | |
| 30 virtual void SetUp() { | |
| 31 UILayoutTest::SetUp(); | |
| 32 } | |
| 33 | |
| 34 void AddJSTestResources() { | |
| 35 // Add other paths our tests require. | |
| 36 FilePath js_dir = FilePath(). | |
| 37 AppendASCII("fast").AppendASCII("js"); | |
| 38 AddResourceForLayoutTest(js_dir, FilePath().AppendASCII("resources")); | |
| 39 } | |
| 40 | |
| 41 // Runs each test in an array of strings until it hits a NULL. | |
|
jsbell
2012/01/05 19:03:55
I see this pattern used in dom_storage_uitest.cc,
| |
| 42 void RunTests(const char** files) { | |
| 43 while (*files) { | |
| 44 RunLayoutTest(*files, kNoHttpPort); | |
|
jsbell
2012/01/05 19:03:55
Possibly pass the port into this function, so we d
| |
| 45 ++files; | |
| 46 } | |
| 47 } | |
| 48 | |
| 49 FilePath test_dir_; | |
| 50 }; | |
| 51 | |
| 52 TEST_F(IndexedDBUILayoutTest, LayoutTests) { | |
| 53 InitializeForLayoutTest(test_dir_, FilePath(), kNoHttpPort); | |
|
jsbell
2012/01/05 19:03:55
e.g.:
const int port = kNoHttpPort;
InitializeForL
| |
| 54 AddJSTestResources(); | |
| 55 RunTests(kLayoutTestFileNames); | |
| 56 } | |
| OLD | NEW |