Index: includes/path.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/path.inc,v
retrieving revision 1.52
diff -u -p -r1.52 path.inc
--- includes/path.inc	6 Dec 2009 23:56:47 -0000	1.52
+++ includes/path.inc	7 Dec 2009 04:49:14 -0000
@@ -161,7 +161,7 @@ function drupal_cache_system_paths() {
   // Check if the system paths for this page were loaded from cache in this
   // request to avoid writing to cache on every request.
   $cache = &drupal_static('drupal_lookup_path', array());
-  if (empty($cache['system_paths'])) {
+  if (empty($cache['system_paths']) && !empty($cache['map'])) {
     // Generate a cache ID (cid) specifically for this page.
     $cid = current_path();
     // The static $map array used by drupal_lookup_path() includes all
Index: modules/contact/contact.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/contact/contact.test,v
retrieving revision 1.38
diff -u -p -r1.38 contact.test
--- modules/contact/contact.test	16 Oct 2009 03:01:54 -0000	1.38
+++ modules/contact/contact.test	7 Dec 2009 03:59:45 -0000
@@ -144,6 +144,7 @@ class ContactSitewideTestCase extends Dr
     }
     // Submit contact form one over limit.
     $this->drupalGet('contact');
+    $this->assertResponse(403, t('Access denied to anonymous user after reaching message treshold.'));
     $this->assertRaw(t('You cannot send more than %number messages in @interval. Please try again later.', array('%number' => variable_get('contact_threshold_limit', 3), '@interval' => format_interval(600))), t('Message threshold reached.'));
 
     // Delete created categories.
Index: modules/locale/locale.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/locale/locale.test,v
retrieving revision 1.54
diff -u -p -r1.54 locale.test
--- modules/locale/locale.test	3 Dec 2009 15:33:42 -0000	1.54
+++ modules/locale/locale.test	7 Dec 2009 04:43:13 -0000
@@ -85,13 +85,12 @@ class LocaleConfigurationTest extends Dr
     $edit = array(
       'site_default' => $langcode,
     );
-    $this->drupalPost($path, $edit, t('Save configuration'));
+    $this->drupalPost(NULL, $edit, t('Save configuration'));
     $this->assertNoFieldChecked('edit-site-default-en', t('Default language updated.'));
     $this->assertEqual($this->getUrl(), url('admin/config/regional/language', array('absolute' => TRUE)), t('Correct page redirection.'));
 
     // Ensure we can't delete the default language.
-    $path = 'admin/config/regional/language/delete/' . $langcode;
-    $this->drupalGet($path);
+    $this->drupalGet('admin/config/regional/language/delete/' . $langcode);
     $this->assertEqual($this->getUrl(), url('admin/config/regional/language', array('absolute' => TRUE)), t('Correct page redirection.'));
     $this->assertText(t('The default language cannot be deleted.'), t('Failed to delete the default language.'));
 
@@ -106,53 +105,45 @@ class LocaleConfigurationTest extends Dr
     $edit = array(
       'site_default' => 'en',
     );
-    $this->drupalPost($path, $edit, t('Save configuration'));
+    $this->drupalPost(NULL, $edit, t('Save configuration'));
     $this->assertFieldChecked('edit-enabled-en', t('Default language re-enabled.'));
 
     // Ensure 'edit' link works.
     $this->clickLink(t('edit'));
     $this->assertTitle(t('Edit language | Drupal'), t('Page title is "Edit language".'));
     // Edit a language.
-    $path = 'admin/config/regional/language/edit/' . $langcode;
     $name = $this->randomName(16);
     $edit = array(
       'name' => $name,
     );
-    $this->drupalPost($path, $edit, t('Save language'));
+    $this->drupalPost('admin/config/regional/language/edit/' . $langcode, $edit, t('Save language'));
     $this->assertRaw($name, t('The language has been updated.'));
     $this->assertEqual($this->getUrl(), url('admin/config/regional/language', array('absolute' => TRUE)), t('Correct page redirection.'));
 
     // Ensure 'delete' link works.
-    $path = 'admin/config/regional/language';
-    $this->drupalGet($path);
+    $this->drupalGet('admin/config/regional/language');
     $this->clickLink(t('delete'));
     $this->assertText(t('Are you sure you want to delete the language'), t('"delete" link is correct.'));
     // Delete the language.
-    $path = 'admin/config/regional/language/delete/' . $langcode;
-    $this->drupalGet($path);
+    $this->drupalGet('admin/config/regional/language/delete/' . $langcode);
     // First test the 'cancel' link.
     $this->clickLink(t('Cancel'));
     $this->assertEqual($this->getUrl(), url('admin/config/regional/language', array('absolute' => TRUE)), t('Correct page redirection.'));
     $this->assertRaw($name, t('The language was not deleted.'));
     // Delete the language for real. This a confirm form, we do not need any
     // fields changed.
-    $this->drupalPost($path, array(), t('Delete'));
+    $this->drupalPost('admin/config/regional/language/delete/' . $langcode, array(), t('Delete'));
     // We need raw here because %locale will add HTML.
     $this->assertRaw(t('The language %locale has been removed.', array('%locale' => $name)), t('The test language has been removed.'));
     $this->assertEqual($this->getUrl(), url('admin/config/regional/language', array('absolute' => TRUE)), t('Correct page redirection.'));
-    // Reload to remove $name.
-    $this->drupalGet($path);
-    $this->assertNoText($langcode, t('Language code not found.'));
-    $this->assertNoText($name, t('Name not found.'));
-    $this->assertNoText($native, t('Native not found.'));
+    // Verify that language is no longer found.
+    $this->drupalGet('admin/config/regional/language/delete/' . $langcode);
+    $this->assertResponse(404, t('Language no longer found.'));
 
     // Ensure we can't delete the English language.
-    $path = 'admin/config/regional/language/delete/en';
-    $this->drupalGet($path);
+    $this->drupalGet('admin/config/regional/language/delete/en');
     $this->assertEqual($this->getUrl(), url('admin/config/regional/language', array('absolute' => TRUE)), t('Correct page redirection.'));
     $this->assertText(t('The English language cannot be deleted.'), t('Failed to delete English language.'));
-
-    $this->drupalLogout();
   }
 
 }
@@ -1323,7 +1314,7 @@ class LocaleContentFunctionalTest extend
     // User to add and remove language.
     $admin_user = $this->drupalCreateUser(array('administer languages', 'administer content types', 'access administration pages'));
     // User to create a node.
-    $web_user = $this->drupalCreateUser(array('create page content', 'edit any page content'));
+    $web_user = $this->drupalCreateUser(array('create article content', 'create page content', 'edit any page content'));
 
     // Add custom language.
     $this->drupalLogin($admin_user);
@@ -1382,12 +1373,12 @@ class LocaleContentFunctionalTest extend
     $this->drupalLogin($web_user);
     $this->drupalGet('node/add/article');
     // Verify language select list is not present.
-    $this->assertNoRaw('<select name="language" class="form-select" id="edit-language" >', t('Language select not present on add article form.'));
+    $this->assertNoFieldByName('language', '', t('Language select not present on add article form.'));
 
     // Verify language selection appears on add page form.
     $this->drupalGet('node/add/page');
     // Verify language select list is present.
-    $this->assertRaw('<select name="language" class="form-select" id="edit-language" >', t('Language select present on add page form.'));
+    $this->assertFieldByName('language', '', t('Language select present on add page form.'));
     // Ensure enabled language appears.
     $this->assertText($name, t('Enabled language present.'));
     // Ensure disabled language doesn't appear.
Index: modules/path/path.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/path/path.test,v
retrieving revision 1.27
diff -u -p -r1.27 path.test
--- modules/path/path.test	2 Dec 2009 19:26:22 -0000	1.27
+++ modules/path/path.test	7 Dec 2009 04:55:57 -0000
@@ -64,6 +64,7 @@ class PathTestCase extends DrupalWebTest
     // Confirm that the alias works.
     $this->drupalGet($edit['alias']);
     $this->assertText($node1->title[LANGUAGE_NONE][0]['value'], 'Alias works.');
+    $this->assertNoResponse(404);
 
     // Change alias.
     $pid = $this->getPID($edit['alias']);
@@ -75,6 +76,7 @@ class PathTestCase extends DrupalWebTest
     // Confirm that the alias works.
     $this->drupalGet($edit['alias']);
     $this->assertText($node1->title[LANGUAGE_NONE][0]['value'], 'Changed alias works.');
+    $this->assertNoResponse(404);
 
     drupal_static_reset('drupal_lookup_path');
     // Confirm that previous alias no longer works.
@@ -99,6 +101,7 @@ class PathTestCase extends DrupalWebTest
     // Confirm that the alias no longer works.
     $this->drupalGet($edit['alias']);
     $this->assertNoText($node1->title, 'Alias was successfully deleted.');
+    $this->assertResponse(404);
   }
 
   /**
@@ -116,6 +119,7 @@ class PathTestCase extends DrupalWebTest
     // Confirm that the alias works.
     $this->drupalGet($edit['path[alias]']);
     $this->assertText($node1->title[LANGUAGE_NONE][0]['value'], 'Alias works.');
+    $this->assertNoResponse(404);
 
     // Change alias.
     $previous = $edit['path[alias]'];
@@ -125,6 +129,7 @@ class PathTestCase extends DrupalWebTest
     // Confirm that the alias works.
     $this->drupalGet($edit['path[alias]']);
     $this->assertText($node1->title[LANGUAGE_NONE][0]['value'], 'Changed alias works.');
+    $this->assertNoResponse(404);
 
     // Make sure that previous alias no longer works.
     $this->drupalGet($previous);
@@ -147,6 +152,7 @@ class PathTestCase extends DrupalWebTest
     // Confirm that the alias no longer works.
     $this->drupalGet($edit['path[alias]']);
     $this->assertNoText($node1->title, 'Alias was successfully deleted.');
+    $this->assertResponse(404);
   }
 
   function getPID($alias) {
Index: modules/search/search.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/search/search.test,v
retrieving revision 1.43
diff -u -p -r1.43 search.test
--- modules/search/search.test	2 Dec 2009 19:26:22 -0000	1.43
+++ modules/search/search.test	7 Dec 2009 04:58:11 -0000
@@ -424,7 +424,10 @@ class SearchBlockTestCase extends Drupal
     $this->assertText('Your search yielded no results');
 
     // Test a search from the block on a 404 page.
-    $this->drupalPost('foo', $terms, t('Search'));
+    $this->drupalGet('foo');
+    $this->assertResponse(404);
+    $this->drupalPost(NULL, $terms, t('Search'));
+    $this->assertResponse(404);
     $this->assertText('Your search yielded no results');
 
     // Test a search from the block when it doesn't appear on the search page.
Index: modules/simpletest/tests/session.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/simpletest/tests/session.test,v
retrieving revision 1.19
diff -u -p -r1.19 session.test
--- modules/simpletest/tests/session.test	4 Nov 2009 05:05:52 -0000	1.19
+++ modules/simpletest/tests/session.test	7 Dec 2009 05:04:06 -0000
@@ -309,12 +309,14 @@ class SessionHttpsTestCase extends Drupa
     $this->curlClose();
     $this->drupalGet($this->httpsUrl('admin'), array(), array('Cookie: ' . $cookie));
     $this->assertText(t('Administer'));
+    $this->assertNoResponse(403);
 
     // Verify that user is not logged in on non-secure URL.
     if (!$is_https) {
       $this->curlClose();
       $this->drupalGet('admin', array(), array('Cookie: ' . $cookie));
       $this->assertNoText(t('Administer'));
+      $this->assertResponse(403);
     }
 
     // Clear browser cookie jar.
@@ -373,9 +375,11 @@ class SessionHttpsTestCase extends Drupa
         $this->drupalGet($url, array(), array('Cookie: ' . $cookie));
         if ($cookie_key == $url_key) {
           $this->assertText(t('Administer'));
+          $this->assertNoResponse(403);
         }
         else {
           $this->assertNoText(t('Administer'));
+          $this->assertResponse(403);
         }
       }
     }
