Add rigorous tests for content hash fetch behavior.

For better or worse, there are lots of subtleties around content hash
fetching code and how computed hashes are handled. This CL aims to
document those with tests.

The intention is to make sure that these don't regress unknowingly
while code is refactored in the future.

Bug: 796395
Change-Id: Iecc106a992596955497a1d02b6610c85c1d64364
Reviewed-on: https://chromium-review.googlesource.com/947712
Commit-Queue: Istiaque Ahmed <[email protected]>
Reviewed-by: Devlin <[email protected]>
Cr-Commit-Position: refs/heads/master@{#542748}
diff --git a/chrome/browser/extensions/extension_protocols_unittest.cc b/chrome/browser/extensions/extension_protocols_unittest.cc
index 2049742..c49bb9b 100644
--- a/chrome/browser/extensions/extension_protocols_unittest.cc
+++ b/chrome/browser/extensions/extension_protocols_unittest.cc
@@ -562,7 +562,7 @@
 
   // Valid and readable 1024.js.
   {
-    TestContentVerifyJobObserver observer(extension_id, kRelativePath);
+    TestContentVerifySingleJobObserver observer(extension_id, kRelativePath);
 
     content_verifier_->OnExtensionLoaded(browser_context(), extension.get());
     // Wait for PostTask to ContentVerifierIOData::AddData() to finish.
@@ -574,7 +574,7 @@
 
   // chmod -r 1024.js.
   {
-    TestContentVerifyJobObserver observer(extension->id(), kRelativePath);
+    TestContentVerifySingleJobObserver observer(extension->id(), kRelativePath);
     base::FilePath file_path = unzipped_path.AppendASCII(kJs);
     ASSERT_TRUE(base::MakeFileUnreadable(file_path));
     EXPECT_EQ(net::ERR_ACCESS_DENIED, DoRequestOrLoad(extension, kJs).result());
@@ -588,7 +588,7 @@
 
   // Delete 1024.js.
   {
-    TestContentVerifyJobObserver observer(extension_id, kRelativePath);
+    TestContentVerifySingleJobObserver observer(extension_id, kRelativePath);
     base::FilePath file_path = unzipped_path.AppendASCII(kJs);
     ASSERT_TRUE(base::DieFileDie(file_path, false));
     EXPECT_EQ(net::ERR_FILE_NOT_FOUND,
@@ -623,7 +623,7 @@
 
   // Request empty.js.
   {
-    TestContentVerifyJobObserver observer(extension_id, kRelativePath);
+    TestContentVerifySingleJobObserver observer(extension_id, kRelativePath);
 
     content_verifier_->OnExtensionLoaded(browser_context(), extension.get());
     // Wait for PostTask to ContentVerifierIOData::AddData() to finish.
@@ -638,7 +638,7 @@
   // current behavior of ContentVerifyJob.
   // TODO(lazyboy): The behavior is probably incorrect.
   {
-    TestContentVerifyJobObserver observer(extension->id(), kRelativePath);
+    TestContentVerifySingleJobObserver observer(extension->id(), kRelativePath);
     base::FilePath file_path = unzipped_path.AppendASCII(kEmptyJs);
     ASSERT_TRUE(base::MakeFileUnreadable(file_path));
     EXPECT_EQ(net::ERR_ACCESS_DENIED,
@@ -651,7 +651,7 @@
   // current behavior of ContentVerifyJob.
   // TODO(lazyboy): The behavior is probably incorrect.
   {
-    TestContentVerifyJobObserver observer(extension_id, kRelativePath);
+    TestContentVerifySingleJobObserver observer(extension_id, kRelativePath);
     base::FilePath file_path = unzipped_path.AppendASCII(kEmptyJs);
     ASSERT_TRUE(base::DieFileDie(file_path, false));
     EXPECT_EQ(net::ERR_FILE_NOT_FOUND,