Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(21)

Side by Side Diff: chrome/test/base/v8_unit_test.cc

Issue 11363170: Add an accessibility audit test for WebUI pages (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Reinstate copyright header Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/chrome_tests.gypi ('k') | chrome/test/data/webui/accessibility_audit_browsertest.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 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 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 "chrome/test/base/v8_unit_test.h" 5 #include "chrome/test/base/v8_unit_test.h"
6 6
7 #include "base/file_util.h" 7 #include "base/file_util.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/path_service.h" 9 #include "base/path_service.h"
10 #include "base/string_piece.h" 10 #include "base/string_piece.h"
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 &gen_test_data_directory)); 129 &gen_test_data_directory));
130 130
131 FilePath mockPath; 131 FilePath mockPath;
132 ASSERT_TRUE(PathService::Get(base::DIR_SOURCE_ROOT, &mockPath)); 132 ASSERT_TRUE(PathService::Get(base::DIR_SOURCE_ROOT, &mockPath));
133 mockPath = mockPath.AppendASCII("chrome"); 133 mockPath = mockPath.AppendASCII("chrome");
134 mockPath = mockPath.AppendASCII("third_party"); 134 mockPath = mockPath.AppendASCII("third_party");
135 mockPath = mockPath.AppendASCII("mock4js"); 135 mockPath = mockPath.AppendASCII("mock4js");
136 mockPath = mockPath.AppendASCII("mock4js.js"); 136 mockPath = mockPath.AppendASCII("mock4js.js");
137 AddLibrary(mockPath); 137 AddLibrary(mockPath);
138 138
139 FilePath accessibilityAuditPath;
140 ASSERT_TRUE(PathService::Get(base::DIR_SOURCE_ROOT, &accessibilityAuditPath));
141 accessibilityAuditPath = accessibilityAuditPath.AppendASCII("third_party");
142 accessibilityAuditPath =
143 accessibilityAuditPath.AppendASCII("accessibility-developer-tools");
144 accessibilityAuditPath = accessibilityAuditPath.AppendASCII("gen");
145 accessibilityAuditPath = accessibilityAuditPath.AppendASCII("axs_testing.js");
146 AddLibrary(accessibilityAuditPath);
147
139 FilePath testApiPath; 148 FilePath testApiPath;
140 ASSERT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &testApiPath)); 149 ASSERT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &testApiPath));
141 testApiPath = testApiPath.AppendASCII("webui"); 150 testApiPath = testApiPath.AppendASCII("webui");
142 testApiPath = testApiPath.AppendASCII("test_api.js"); 151 testApiPath = testApiPath.AppendASCII("test_api.js");
143 AddLibrary(testApiPath); 152 AddLibrary(testApiPath);
144 } 153 }
145 154
146 void V8UnitTest::SetUp() { 155 void V8UnitTest::SetUp() {
147 v8::Handle<v8::ObjectTemplate> global = v8::ObjectTemplate::New(); 156 v8::Handle<v8::ObjectTemplate> global = v8::ObjectTemplate::New();
148 v8::Handle<v8::String> logString = v8::String::New("log"); 157 v8::Handle<v8::String> logString = v8::String::New("log");
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
264 EXPECT_EQ(2U, testResult->Length()); 273 EXPECT_EQ(2U, testResult->Length());
265 if (::testing::Test::HasNonfatalFailure()) 274 if (::testing::Test::HasNonfatalFailure())
266 return v8::Undefined(); 275 return v8::Undefined();
267 testResult_ok = testResult->Get(0)->BooleanValue(); 276 testResult_ok = testResult->Get(0)->BooleanValue();
268 if (!testResult_ok) { 277 if (!testResult_ok) {
269 v8::String::Utf8Value message(testResult->Get(1)); 278 v8::String::Utf8Value message(testResult->Get(1));
270 LOG(ERROR) << *message; 279 LOG(ERROR) << *message;
271 } 280 }
272 return v8::Undefined(); 281 return v8::Undefined();
273 } 282 }
OLDNEW
« no previous file with comments | « chrome/chrome_tests.gypi ('k') | chrome/test/data/webui/accessibility_audit_browsertest.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698