Index: wp-testcase/test_user_capabilities.php
===================================================================
--- wp-testcase/test_user_capabilities.php	(revision 373)
+++ wp-testcase/test_user_capabilities.php	(working copy)
@@ -29,6 +29,14 @@
 		#$GLOBALS['wp_roles'] = new WP_Roles();
 	}
 
+	function _meta_yes_you_can( $key, $post_id, $user_id, $cap ) {
+		return true;
+	}
+
+	function _meta_no_you_cant( $key, $post_id, $user_id, $cap ) {
+		return false;
+	}
+
 	// test the default roles
 
 	function test_user_administrator() {
@@ -445,6 +453,16 @@
 		// other authors and contributors can't
 		$this->assertFalse($author_2->has_cap('delete_post', $post));
 		$this->assertFalse($contributor->has_cap('delete_post', $post));
+
+		// Test meta authorization callbacks
+		if ( function_exists( 'register_meta') ) {
+			$this->assertFalse( $admin->has_cap('delete_post_meta', '_protected', $post) );
+			register_meta( '_protected', 'post', array( 'auth_callback' => array( &$this, '_meta_yes_you_can') ) );
+			$this->assertTrue( $admin->has_cap('delete_post_meta', '_protected', $post) );
+			$this->assertTrue( $admin->has_cap('delete_post_meta', 'not_protected', $post) );
+			register_meta( 'not_protected', 'post', array( 'auth_callback' => array( &$this, '_meta_no_you_cant') ) );
+			$this->assertFalse( $admin->has_cap('delete_post_meta', 'not_protected', $post) );
+		}
 	}
 
 	function test_page_meta_caps() {
