diff --git a/modules/simpletest/tests/menu.test b/modules/simpletest/tests/menu.test
index 2578beb..585dab3 100644
--- a/modules/simpletest/tests/menu.test
+++ b/modules/simpletest/tests/menu.test
@@ -34,6 +34,33 @@ class MenuRouterTestCase extends DrupalWebTestCase {
   }
 
   /**
+   * Test local tasks with an access callback.
+   */
+  function testLocalTasksWithAccessCallback() {
+    $this->drupalGet('menu-test/local-tasks');
+
+    $this->assertText('This is menu_test_callback().', t('Raw text found on the page'));
+
+    // Verify that only the first and third local tasks are shown.
+    $this->assertText(t('First local task'), t('First local task is shown'));
+    $this->assertNoText(t('Second local task'), t('Second local task is not shown'));
+    $this->assertText(t('Third local task'), t('Third local task is shown'));
+
+    // Click on third local task and repeat tests.
+    $this->clickLink(t('Third local task'));
+    $this->assertText('This is menu_test_callback().', t('Raw text found on the page'));
+
+    // Verify that only the first and third local tasks are shown.
+    $this->assertText(t('First local task'), t('First local task is shown'));
+    $this->assertNoText(t('Second local task'), t('Second local task is not shown'));
+    $this->assertText(t('Third local task'), t('Third local task is shown'));
+
+    // Got the second local task and make sure that access is denied.
+    $this->drupalGet('menu-test/local-tasks/2');
+    $this->assertText(t('Access denied'), t('Access to second local task is denied'));
+  }
+
+  /**
    * Tests page title of MENU_CALLBACKs.
    */
   function testTitleMenuCallback() {
diff --git a/modules/simpletest/tests/menu_test.module b/modules/simpletest/tests/menu_test.module
index 3046a04..5e896df 100644
--- a/modules/simpletest/tests/menu_test.module
+++ b/modules/simpletest/tests/menu_test.module
@@ -317,10 +317,52 @@ function menu_test_menu() {
     'access callback' => TRUE,
   );
 
+  $items['menu-test/local-tasks'] = array(
+    'title' => 'Local task access check',
+    'page callback' => 'menu_test_callback',
+    'access callback' => TRUE,
+  );
+
+  $items['menu-test/local-tasks/1'] = array(
+    'title' => 'First local task',
+    'page callback' => 'menu_test_callback',
+    'access callback' => 'menu_test_access_callback_local_task',
+    'access arguments' => array(2),
+    'type' => MENU_DEFAULT_LOCAL_TASK,
+  );
+
+  $items['menu-test/local-tasks/2'] = array(
+    'title' => 'Second local task',
+    'page callback' => 'menu_test_callback',
+    'access callback' => 'menu_test_access_callback_local_task',
+    'access arguments' => array(2),
+    'type' => MENU_LOCAL_TASK,
+  );
+
+  $items['menu-test/local-tasks/3'] = array(
+    'title' => 'Third local task',
+    'page callback' => 'menu_test_callback',
+    'access callback' => 'menu_test_access_callback_local_task',
+    'access arguments' => array(2),
+    'type' => MENU_LOCAL_TASK,
+  );
+
   return $items;
 }
 
 /**
+ * Check access for local tasks with an argument.
+ * @param $id
+ *   Argument passed in from the url.
+ *
+ * @return
+ *   TRUE for all ids except 2.
+ */
+function menu_test_access_callback_local_task($id) {
+  return $id != '2';
+}
+
+/**
  * Dummy argument loader for hook_menu() to point to.
  */
 function menu_test_argument_load($arg1) {
