~mozillateam/firefox/firefox.disco

« back to all changes in this revision

Viewing changes to debian/patches/test-fixes/xpcshell-xpcom-no-writes-to-testdir-or-appdir.patch

  • Committer: Chris Coulson
  • Date: 2013-02-20 09:17:36 UTC
  • mto: This revision was merged to the branch mainline in revision 972.
  • Revision ID: chris.coulson@canonical.com-20130220091736-ofjaczrz2wc4nidl
* New upstream release from the beta channel
* Refresh patches
  - update debian/patches/mozilla-kde.patch
* Drop patches fixed upstream
  - remove debian/patches/ionmonkey-hardfp-support.patch
  - update debian/patches/series.in
* firefox-gnome-support needs explicit dependency on libnotify
  - update debian/control{,.in}
* Add support for autopkgtest, package the xpcshell, reftest and
  mochitest testsuites and migrate the xpcshell-tests, reftest, crashtest,
  jstestbrowser and mochitest targets to this. Note that tests that can't
  be ran as an autopkgtest (eg, if they require write permissions to the
  application directory) will still be ran at build time
  - add firefox-testsuite package in debian/control.in
  - update debian/control
  - add debian/firefox-testsuite.install.in
  - add debian/firefox-testsuite.links.in
  - update debian/build/mozbuild.mk
  - update debian/rules
  - drop xpcshell-tests, reftest, crashtest, jstestbrowser and mochitest
    targets from debian/build/testsuite.mk, add xpcshell-tests-build
    and the ability to run xpcshell-tests with our own reduced manifest
  - add debian/tests/control
  - add debian/tests/crashtest
  - add debian/tests/jstestbrowser
  - add debian/tests/mochitest
  - add debian/tests/reftest
  - add debian/tests/xpcshell-tests
  - add debian/testing/run_mochitest.in
  - add debian/testing/run_xpcshell_tests.in
  - add debian/testing/run_reftest.in
  - add debian/testing/testrunhelper.py
  - update debian/config/mozconfig.in to always build with --enable-tests
  - add debian/testing/xpcshell-build.ini
* Ensure that the directory provider returns all searchplugin paths during
  the search service xpcshell tests
  - add d/p/test-fixes/xpcshell-search-fix-browser-dirprovider.patch
  - update debian/patches/series.in
* Fix various tests that assume that either the application directory or
  test directory can be written to
  - add d/p/test-fixes/xpcshell-docshell-no-writes-to-appdir.patch
  - add d/p/test-fixes/xpcshell-contentprefs-no-writes-to-appdir.patch
  - add d/p/test-fixes/xpcshell-exthandler-no-writes-to-appdir.patch
  - add d/p/test-fixes/xpcshell-ctypes-no-writes-to-appdir.patch
  - add d/p/test-fixes/xpcshell-xpcom-no-writes-to-testdir-or-appdir.patch
  - add d/p/test-fixes/xpcshell-libpref-no-writes-to-testdir.patch
  - update debian/patches/series.in
* Export NO_PNG_PKG_MANGLE as optipng breaks tests that are dependent
  on image format / size
  - update debian/build/mozbuild.mk
* Don't test that the addon selection dialog appears in test_bug596343.js,
  as we disable this
  - add d/p/test-integration/xpcshell-disable-addon-select-dialog-test-for-adt.patch
  - update debian/patches/series
* Don't write a log file to the script directory from mochitest
  - add d/p/test-integration/mochitest-optional-websock-log.patch
  - update debian/patches/series.in
* Fix a failure in test_nodb_pluschanges.js due to const redeclaration
  - add d/p/test-fixes/xpcshell-search-fix-const-redeclaration.patch
  - update debian/patches/series.in
* Don't run the GConf-specific test_421977.js on systems where GSettings
  is available, as it will fail
  - add d/p/t-f/xpcshell-shell-disable-gconf-tests-when-using-gsettings.patch
  - update debian/patches/series.in
* Disable test_upgrade.js and test_upgrade_strictcompat.js xpcshell tests
  for now as they require write access to the application directory
  - add d/p/test-integration/xpcshell-disable-tests-which-need-appdir-write-access.patch
  - update debian/patches/series.in
* Disable test_browserGlue_distribution.js for now as it requires write
  access to the application directory
  - update d/p/test-integration/xpcshell-disable-tests-which-need-appdir-write-access.patch
* Reset the "browser" and "embed-app" content prefs after running content
  mochitests, so that the subsequent DOM browser-element tests don't
  fail
  - add d/p/test-fixes/mochitest-content-reset-permissions-when-done.patch
  - update debian/patches/series.in
* Disable various failing mochitests:
  - add debian/testing/mochitest.json
  - add debian/testing/mochitest-chrome.json
  - update debian/firefox-testsuite.install.in
* Fix issue where some tests were being added to the mochitest tests.jar
  using their absolute path in the build tree
  - add debian/patches/test-fixes/mochitest-tests-jar-fix.patch
  - update debian/patches/series.in
* Don't run the GConf specific browser_420786.js mochitest on systems where
  GSettings is available, as it will fail
  - add d/p/t-f/mochitest-shell-disable-gconf-tests-when-using-gsettings.patch
  - update debian/patches/series.in
* Don't ship the browser_bug538331.js mochitest as this isn't relevant
  when not using the Mozilla AUS
  - add d/p/test-fixes/mochitest-dont-ship-browser-postupdate-test.patch
  - update debian/patches/series.in
* Make "--test-manifest" work when running chrome, browser-chrome and a11y
  mochitests so that we can maintain a distro manifest for these
  - add d/p/test-integration/mochitest-allow-test-manifest-for-chrome.patch
  - update debian/patches/series.in
* Disable failing reftests
  - add d/p/test-overrides/reftest-disable-failing-tests.patch
  - update debian/patches/series.in
* Add vendor xpcshell tests to verify that the search service loads
  the expected number of search plugins from each language pack
  - update debian/build/mozbuild.mk
  - add debian/firefox-testsuite.dirs.in
  - update debian/firefox-testsuite.install.in
  - update debian/rules
  - add debian/testing/xpcshell-package-tests/head_package_tests.js
  - add debian/testing/xpcshell-package-tests/test_searchplugins_valid.js
  - add debian/testing/xpcshell-package-tests/test_searchplugins_valid_real.js
  - add debian/testing/xpcshell-package-tests/xpcshell.ini
  - update debian/tests/control
  - add debian/tests/xpcshell-package-tests
* Drop the hacky perl scripts that were being used to make sure the language
  packs ship the correct plugins. Add a xpcshell test instead
  - update debian/build/mozbuild.mk
  - update debian/rules
  - remove debian/build/refresh-search-modifications.pl
  - remove debian/build/verify-search-overrides.pl
  - remove debian/config/search-mods.list
  - update debian/control.in
  - remove debian/searchplugins/compute-overrides.json
  - add debian/testing/xpcshell-package-tests/test_ubuntu_searchplugins.js
  - add debian/testing/xpcshell-package-tests/test_ubuntu_searchplugins_real.js
  - update debian/testing/xpcshell-package-tests/xpcshell.ini
* Fix a test failure with the Italian Amazon search plugin 
  - update debian/searchplugins/it/amazon-it.xml
* We set intl.locale.matchOS to ensure that Firefox uses the environment
  locale. Add a test to make sure this works as expected
  - add debian/testing/xpcshell-package-tests/test_locale_matchOS.js
  - add debian/testing/xpcshell-package-tests/test_locale_matchOS_real.js
  - update debian/testing/xpcshell-package-tests/head_package_tests.js
  - update debian/testing/xpcshell-package-tests/test_searchplugins_valid.js
  - update debian/testing/xpcshell-package-tests/test_ubuntu_searchplugins.js
  - update debian/testing/xpcshell-package-tests/xpcshell.ini
  - update debian/tests/control
  - update debian/tests/crashtest
  - update debian/tests/jstestbrowser
  - update debian/tests/mochitest
  - update debian/tests/reftest
  - update debian/tests/xpcshell-package-tests
  - update debian/tests/xpcshell-tests
* We modify the user agent, so test that it is correct
  - add debian/testing/xpcshell-package-tests/test_ubuntu_useragent.js
  - update debian/testing/xpcshell-package-tests/xpcshell.ini
* LP: #974146 - Add a "Open a New Private Window" action to the desktop file
  - update debian/firefox.desktop.in
* Don't try to override the Amazon searchplugin for Kashubian or Mongolian,
  as it doesn't exist there
  - add debian/searchplugins/csb/list.txt
  - add debian/searchplugins/mn/list.txt
  - update d/t/xpcshell-package-tests/test_ubuntu_searchplugins_real.js
* Testpilot only enabled on beta now
  - update debian/firefox.install.in
* Don't run dh_scour on the testsuite package, as this screws up a lot
  of reftests and crashtests
  - update debian/build/mozbuild.mk
* Add a test to make sure all of the language packs are loadable by the
  addon manager
  - add debian/testing/xpcshell-package-tests/test_langpack_load.js
  - update debian/testing/xpcshell-package-tests/xpcshell.ini
* Add a test to make sure language pack chrome is registered correctly
  - add debian/testing/xpcshell-package-tests/test_langpack_chrome.js
  - update debian/testing/xpcshell-package-tests/xpcshell.ini
* Disable failing xpcshell tests
  - add d/p/test-overrides/xpcshell-disable-failing-tests.patch
  - update debian/patches/series.in
* Add JUnit output support for reftests
  - add d/p/test-integration/reftest-output-junit-xml.patch
  - update debian/patches/series.in
  - update debian/testing/run_reftest.in
* Allow xpcshell tests to be run with JUnit outputting, and include a fix
  to make sure that the output matches the schema
  - update debian/testing/run_xpcshell_tests.in
  - add d/p/test-integration/xpcshell-output-valid-junit-xml.patch
  - update debian/patches/series.in
* Add JUnit output support for mochitests
  - add d/p/test-integration/mochitest-output-junit-xml.patch
  - update debian/patches/series.in
  - update debian/testing/run_mochitest.in
* Turn on JUnit XML output for all tests
  - update debian/build/mozbuild.mk
  - update debian/tests/crashtest
  - update debian/tests/jstestbrowser
  - update debian/tests/mochitest
  - update debian/tests/reftest
  - update debian/tests/xpcshell-package-tests
  - update debian/tests/xpcshell-tests

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
Index: firefox-trunk-19.0~a1~hg20121114r113217/xpcom/tests/unit/test_bug476919.js
 
2
===================================================================
 
3
--- firefox-trunk-19.0~a1~hg20121114r113217.orig/xpcom/tests/unit/test_bug476919.js     2012-11-14 21:08:45.000000000 +0000
 
4
+++ firefox-trunk-19.0~a1~hg20121114r113217/xpcom/tests/unit/test_bug476919.js  2012-11-17 01:53:49.599156760 +0000
 
5
@@ -5,17 +5,14 @@
 
6
   // skip this test on Windows
 
7
   var isWindows = ("@mozilla.org/windows-registry-key;1" in Components.classes);
 
8
   if (!isWindows) {
 
9
-    var testDir = __LOCATION__.parent;
 
10
+    var testDir = do_get_profile();
 
11
     // create a test file, then symlink it, then check that we think it's a symlink
 
12
     var targetFile = testDir.clone();
 
13
     targetFile.append("target.txt");
 
14
-    if (!targetFile.exists())
 
15
-      targetFile.create(Ci.nsIFile.NORMAL_FILE_TYPE, 0644);
 
16
+    targetFile.create(Ci.nsIFile.NORMAL_FILE_TYPE, 0644);
 
17
 
 
18
     var link = testDir.clone();
 
19
     link.append("link");
 
20
-    if (link.exists())
 
21
-      link.remove(false);
 
22
 
 
23
     var ln = Cc["@mozilla.org/file/local;1"].createInstance(Ci.nsILocalFile);
 
24
     ln.initWithPath("/bin/ln");
 
25
Index: firefox-trunk-19.0~a1~hg20121114r113217/xpcom/tests/unit/test_iniProcessor.js
 
26
===================================================================
 
27
--- firefox-trunk-19.0~a1~hg20121114r113217.orig/xpcom/tests/unit/test_iniProcessor.js  2012-11-14 21:08:45.000000000 +0000
 
28
+++ firefox-trunk-19.0~a1~hg20121114r113217/xpcom/tests/unit/test_iniProcessor.js       2012-11-19 15:09:32.934061498 +0000
 
29
@@ -171,6 +171,9 @@
 
30
           getService(Ci.nsIINIParserFactory);
 
31
 do_check_true(!!factory);
 
32
 
 
33
+var outputDir = do_get_profile();
 
34
+outputDir.append("test_iniProcessor_data");
 
35
+
 
36
 // Test reading from a variety of files. While we're at it, write out each one
 
37
 // and read it back to ensure that nothing changed.
 
38
 while (testnum < testdata.length) {
 
39
@@ -183,24 +186,23 @@
 
40
         continue;
 
41
     do_check_true(parser instanceof Ci.nsIINIParserWriter);
 
42
     // write contents out to a new file
 
43
-    let newfilename = filename + ".new";
 
44
-    let newfile = do_get_file(filename);
 
45
-    newfile.leafName += ".new";
 
46
+    let newfile = outputDir.clone();
 
47
+    newfile.appendRelativePath(filename);
 
48
+    if (!newfile.parent.exists()) {
 
49
+        newfile.parent.create(Ci.nsIFile.DIRECTORY_TYPE, 0755);
 
50
+    }
 
51
     parser.writeFile(newfile);
 
52
     // read new file and make sure the contents are the same.
 
53
-    parser = parserForFile(newfilename);
 
54
+    parser = factory.createINIParser(newfile);
 
55
+    do_check_true(!!parser);
 
56
     checkParserOutput(parser, testdata[testnum - 1].reference);
 
57
-    // cleanup after the test
 
58
-    newfile.remove(false);
 
59
 }
 
60
 
 
61
 dump("INFO | test #" + ++testnum + "\n");
 
62
 
 
63
 // test writing to a new file.
 
64
-let newfile = do_get_file("data/");
 
65
+let newfile = outputDir.clone();
 
66
 newfile.append("nonexistent-file.ini");
 
67
-if (newfile.exists())
 
68
-    newfile.remove(false);
 
69
 do_check_false(newfile.exists());
 
70
 
 
71
 let parser = factory.createINIParser(newfile);
 
72
@@ -216,10 +218,8 @@
 
73
 do_check_true(newfile.exists());
 
74
 checkParserOutput(parser, {section: {key: "value"} });
 
75
 // read it in again, check for same data.
 
76
-parser = parserForFile("data/nonexistent-file.ini");
 
77
+parser = factory.createINIParser(newfile);
 
78
 checkParserOutput(parser, {section: {key: "value"} });
 
79
-// cleanup after the test
 
80
-newfile.remove(false);
 
81
 
 
82
 dump("INFO | test #" + ++testnum + "\n");
 
83
 
 
84
Index: firefox-trunk-19.0~a1~hg20121114r113217/xpcom/tests/unit/test_nsIProcess.js
 
85
===================================================================
 
86
--- firefox-trunk-19.0~a1~hg20121114r113217.orig/xpcom/tests/unit/test_nsIProcess.js    2012-11-14 21:08:45.000000000 +0000
 
87
+++ firefox-trunk-19.0~a1~hg20121114r113217/xpcom/tests/unit/test_nsIProcess.js 2012-11-19 19:07:55.765807352 +0000
 
88
@@ -10,6 +10,8 @@
 
89
                            "\u09AE\u09CB\u099C\u09BF\u09B2\u09BE",
 
90
                            "\uD808\uDE2C\uD808\uDF63\uD808\uDDB7"];
 
91
 
 
92
+gProfileDir = do_get_profile();
 
93
+
 
94
 // test if a process can be started, polled for its running status
 
95
 // and then killed
 
96
 function test_kill()
 
97
@@ -86,33 +88,31 @@
 
98
   test_args(get_test_program("TestUnicodeArguments"), TEST_UNICODE_ARGS, false);
 
99
 }
 
100
 
 
101
-function rename_and_test(asciiName, unicodeName, args, argsAreASCII)
 
102
+function copy_and_test(asciiName, unicodeName, args, argsAreASCII)
 
103
 {
 
104
   var asciiFile = get_test_program(asciiName);
 
105
   var asciiLeaf = asciiFile.leafName;
 
106
   var unicodeLeaf = asciiLeaf.replace(asciiName, unicodeName);
 
107
 
 
108
-  asciiFile.moveTo(null, unicodeLeaf);
 
109
+  asciiFile.copyTo(gProfileDir, unicodeLeaf);
 
110
 
 
111
-  var unicodeFile = get_test_program(unicodeName);
 
112
+  var unicodeFile = get_test_program(unicodeName, gProfileDir);
 
113
 
 
114
   test_args(unicodeFile, args, argsAreASCII);
 
115
-
 
116
-  unicodeFile.moveTo(null, asciiLeaf);
 
117
 }
 
118
 
 
119
 // test passing ASCII and Unicode arguments to an application with a Unicode name
 
120
 function test_unicode_app()
 
121
 {
 
122
-  rename_and_test("TestArguments",
 
123
-                  // "Unicode" in Tamil
 
124
-                  "\u0BAF\u0BC1\u0BA9\u0BBF\u0B95\u0BCB\u0B9F\u0BCD",
 
125
-                  TEST_ARGS, true);
 
126
-
 
127
-  rename_and_test("TestUnicodeArguments",
 
128
-                  // "Unicode" in Thai
 
129
-                  "\u0E22\u0E39\u0E19\u0E34\u0E42\u0E04\u0E14",
 
130
-                  TEST_UNICODE_ARGS, false);
 
131
+  copy_and_test("TestArguments",
 
132
+                // "Unicode" in Tamil
 
133
+                "\u0BAF\u0BC1\u0BA9\u0BBF\u0B95\u0BCB\u0B9F\u0BCD",
 
134
+                TEST_ARGS, true);
 
135
+
 
136
+  copy_and_test("TestUnicodeArguments",
 
137
+                // "Unicode" in Thai
 
138
+                "\u0E22\u0E39\u0E19\u0E34\u0E42\u0E04\u0E14",
 
139
+                TEST_UNICODE_ARGS, false);
 
140
 }
 
141
 
 
142
 // test if we get notified about a blocking process
 
143
Index: firefox-trunk-19.0~a1~hg20121114r113217/xpcom/tests/unit/test_symlinks.js
 
144
===================================================================
 
145
--- firefox-trunk-19.0~a1~hg20121114r113217.orig/xpcom/tests/unit/test_symlinks.js      2012-11-14 21:08:45.000000000 +0000
 
146
+++ firefox-trunk-19.0~a1~hg20121114r113217/xpcom/tests/unit/test_symlinks.js   2012-11-19 16:07:43.461999474 +0000
 
147
@@ -144,7 +144,7 @@
 
148
   if (isWin || isOS2)
 
149
     return;
 
150
 
 
151
-  var testDir = CWD;
 
152
+  var testDir = do_get_profile();
 
153
   testDir.append("test_symlinks");
 
154
 
 
155
   testSymLinks(testDir, false);
 
156
Index: firefox-trunk-19.0~a1~hg20121114r113217/xpcom/tests/unit/head_xpcom.js
 
157
===================================================================
 
158
--- firefox-trunk-19.0~a1~hg20121114r113217.orig/xpcom/tests/unit/head_xpcom.js 2012-11-14 21:08:45.000000000 +0000
 
159
+++ firefox-trunk-19.0~a1~hg20121114r113217/xpcom/tests/unit/head_xpcom.js      2012-11-19 19:07:21.373807965 +0000
 
160
@@ -1,8 +1,11 @@
 
161
 var isWindows = ("@mozilla.org/windows-registry-key;1" in Components.classes);
 
162
 
 
163
-function get_test_program(prog)
 
164
+function get_test_program(prog, dir)
 
165
 {
 
166
-  var progPath = do_get_cwd();
 
167
+  if (!dir)
 
168
+    var progPath = do_get_cwd();
 
169
+  else
 
170
+    var progPath = dir.clone();
 
171
   progPath.append(prog);
 
172
   if (isWindows)
 
173
     progPath.leafName = progPath.leafName + ".exe";