summaryrefslogtreecommitdiffstats
path: root/chrome/test
diff options
context:
space:
mode:
authorpatrick@chromium.org <patrick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-26 04:41:08 +0000
committerpatrick@chromium.org <patrick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-26 04:41:08 +0000
commit5f7ba2900cf1a7f72ee08c76d6989b615e5cdd43 (patch)
tree83306ec336316688a36cd561a2fcae112182e503 /chrome/test
parent636cf88fc365a7c62cc3318f149b3919d148f5d0 (diff)
downloadchromium_src-5f7ba2900cf1a7f72ee08c76d6989b615e5cdd43.zip
chromium_src-5f7ba2900cf1a7f72ee08c76d6989b615e5cdd43.tar.gz
chromium_src-5f7ba2900cf1a7f72ee08c76d6989b615e5cdd43.tar.bz2
- Launch DOM checker in the subdirectory 'dom_checker/', as specified by its
configuration. - Use the cleaned up version of the error message that DOM checker generates. - Remove <!-- NOP --> from test failure messages reported by DOM checker. - Update the expected failures files as a result of these changes. - Disable the test temporarily as this will require a Buildbot change and restart. Review URL: http://codereview.chromium.org/53064 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@12538 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test')
-rw-r--r--chrome/test/data/dom_checker/automation.js3
-rw-r--r--chrome/test/data/dom_checker/dom_checker.html3
-rw-r--r--chrome/test/data/dom_checker/expected_failures-file.txt17
-rw-r--r--chrome/test/data/dom_checker/expected_failures-http.txt17
-rw-r--r--chrome/test/ui/dom_checker_uitest.cc11
5 files changed, 41 insertions, 10 deletions
diff --git a/chrome/test/data/dom_checker/automation.js b/chrome/test/data/dom_checker/automation.js
index b902b6b..8b0cb05 100644
--- a/chrome/test/data/dom_checker/automation.js
+++ b/chrome/test/data/dom_checker/automation.js
@@ -21,6 +21,9 @@ Automation.prototype.GetTestCount = function() {
}
Automation.prototype.AddFailure = function(test) {
+ // Remove any '<!-- NOP -->' that was inserted by DOM checker.
+ test = test.replace(/<!-- NOP -->/, '');
+
this.failures.push(test);
}
diff --git a/chrome/test/data/dom_checker/dom_checker.html b/chrome/test/data/dom_checker/dom_checker.html
index 003bf43..7fcccb6 100644
--- a/chrome/test/data/dom_checker/dom_checker.html
+++ b/chrome/test/data/dom_checker/dom_checker.html
@@ -438,11 +438,12 @@ function GOOD(x) {
/* Log test failure. */
function BAD(x) {
automation.IncrementTestCount();
- automation.AddFailure(x);
bad++;
x = x.replace('frames[0].frames[0]','(blank)').replace('frames[0]','(third-party)');
log('<font color=red>CHECK FAILED : ' + x + ' is possible!</font>');
+
+ automation.AddFailure(x);
}
diff --git a/chrome/test/data/dom_checker/expected_failures-file.txt b/chrome/test/data/dom_checker/expected_failures-file.txt
index 3f8ca6d..2ea9bea 100644
--- a/chrome/test/data/dom_checker/expected_failures-file.txt
+++ b/chrome/test/data/dom_checker/expected_failures-file.txt
@@ -1,6 +1,15 @@
# Expected failures when running from local disk.
-frames[0].history.forward(0) call
-frames[0].length read [value: 0]
-frames[0].postMessage read [value: function () { [native code] }]
-open() frame name lookup
+(blank).history.forward(0) call
+(blank).length read [value: 0]
+(blank).location.assign('about:blank') call
+(blank).location.replace('about:blank') call
+(blank).postMessage read [value: function () { [native code] }]
+(third-party).frames.length read [value: 2]
+(third-party).frames[0] probe [value: [object global]]
+(third-party).history.forward(0) call
+(third-party).length read [value: 2]
+(third-party).postMessage read [value: function () { [native code] }]
+(third-party).window.length read [value: 2]
+(third-party).window[0] probe [value: [object global]]
document.domain = ''
+open() frame name lookup
diff --git a/chrome/test/data/dom_checker/expected_failures-http.txt b/chrome/test/data/dom_checker/expected_failures-http.txt
index 043ea11..cddf5a6 100644
--- a/chrome/test/data/dom_checker/expected_failures-http.txt
+++ b/chrome/test/data/dom_checker/expected_failures-http.txt
@@ -1,5 +1,16 @@
# Expected failures when running over HTTP.
-frames[0].history.forward(0) call
-frames[0].length read [value: 0]
-frames[0].postMessage read [value: function () { [native code] }]
+(blank).document.location write (readback)
+(blank).history.forward(0) call
+(blank).length read [value: 0]
+(blank).location write (readback)
+(blank).location.assign('about:blank') call
+(blank).location.replace('about:blank') call
+(blank).postMessage read [value: function () { [native code] }]
+(third-party).frames.length read [value: 2]
+(third-party).frames[0] probe [value: [object global]]
+(third-party).history.forward(0) call
+(third-party).length read [value: 2]
+(third-party).postMessage read [value: function () { [native code] }]
+(third-party).window.length read [value: 2]
+(third-party).window[0] probe [value: [object global]]
open() frame name lookup
diff --git a/chrome/test/ui/dom_checker_uitest.cc b/chrome/test/ui/dom_checker_uitest.cc
index e9930ce..03912d4 100644
--- a/chrome/test/ui/dom_checker_uitest.cc
+++ b/chrome/test/ui/dom_checker_uitest.cc
@@ -21,6 +21,9 @@ namespace {
static const FilePath::CharType kBaseUrl[] =
FILE_PATH_LITERAL("http://localhost:8000/");
+static const FilePath::CharType kTestDirectory[] =
+ FILE_PATH_LITERAL("dom_checker/");
+
static const FilePath::CharType kStartFile[] =
FILE_PATH_LITERAL("dom_checker.html");
@@ -144,6 +147,8 @@ class DomCheckerTest : public UITest {
L" JSON.stringify(automation.GetFailures()));",
&json_wide);
+ // Note that we don't use ASSERT_TRUE here (and in some other places) as it
+ // doesn't work inside a function with a return type other than void.
EXPECT_TRUE(succeeded);
if (!succeeded)
return false;
@@ -183,7 +188,9 @@ class DomCheckerTest : public UITest {
GURL test_url;
FilePath::StringType start_file(kStartFile);
if (use_http) {
+ FilePath::StringType test_directory(kTestDirectory);
FilePath::StringType url_string(kBaseUrl);
+ url_string.append(test_directory);
url_string.append(start_file);
test_url = GURL(url_string);
} else {
@@ -209,7 +216,7 @@ class DomCheckerTest : public UITest {
} // namespace
-TEST_F(DomCheckerTest, File) {
+TEST_F(DomCheckerTest, DISABLED_File) {
if (!CommandLine::ForCurrentProcess()->HasSwitch(kRunDomCheckerTest))
return;
@@ -218,7 +225,7 @@ TEST_F(DomCheckerTest, File) {
PrintResults(new_passes, new_failures);
}
-TEST_F(DomCheckerTest, Http) {
+TEST_F(DomCheckerTest, DISABLED_Http) {
if (!CommandLine::ForCurrentProcess()->HasSwitch(kRunDomCheckerTest))
return;