// Check validation cache usage:
if (IsAPnaclTest()) {
- // Should have received 3 validation queries:
- // - One for IRT for actual application
- // - Two for two translator nexes
- // The translators don't currently use the IRT, so there is no IRT cache
- // query for those two loads. The PNaCl main nexe comes from a
- // delete-on-close temp file, so it doesn't have a stable identity
- // for validation caching. All three query results should be misses.
- histograms.ExpectUniqueSample("NaCl.ValidationCache.Query",
- nacl::NaClBrowser::CACHE_MISS, 3);
- // Should have received a cache setting afterwards for IRT and translators.
+ // Should have received 4 validation queries:
+ // - Two for the IRT: the app and one of the translator nexes use the IRT.
+ // - Two for the two PNaCl translator nexes.
+ // The PNaCl app nexe comes from a delete-on-close temp file, so it
+ // doesn't have a stable identity for validation caching. Overall, there
+ // are 3 eligible nexes. The first 3 queries for these eligible nexes
+ // are misses, and one of the IRT queries is a hit.
+ histograms.ExpectBucketCount("NaCl.ValidationCache.Query",
+ nacl::NaClBrowser::CACHE_MISS, 3);
+ histograms.ExpectBucketCount("NaCl.ValidationCache.Query",
+ nacl::NaClBrowser::CACHE_HIT, 1);
+ // Should have received a cache setting afterwards (IRT set only once).
histograms.ExpectUniqueSample("NaCl.ValidationCache.Set",
nacl::NaClBrowser::CACHE_HIT, 3);
} else {
class NaClBrowserTestNewlibVcacheExtension:
public NaClBrowserTestNewlibExtension {
public:
- virtual base::FilePath::StringType Variant() OVERRIDE {
+ base::FilePath::StringType Variant() override {
return FILE_PATH_LITERAL("extension_vcache_test/newlib");
}
};
class NaClBrowserTestGLibcVcacheExtension:
public NaClBrowserTestGLibcExtension {
public:
- virtual base::FilePath::StringType Variant() OVERRIDE {
+ base::FilePath::StringType Variant() override {
return FILE_PATH_LITERAL("extension_vcache_test/glibc");
}
};
IN_PROC_BROWSER_TEST_F(NaClBrowserTestGLibcVcacheExtension,
- ValidationCacheOfMainNexe) {
+ MAYBE_GLIBC(ValidationCacheOfMainNexe)) {
// Make sure histograms from child processes have been accumulated in the
// browser process.
base::HistogramTester histograms;
RunLoadTest(FILE_PATH_LITERAL("pnacl_options.html?use_nmf=o_0"));
content::FetchHistogramsFromChildProcesses();
- // Should have received 3 validation queries:
- // - One for IRT for actual application
- // - Two for two translator nexes
- // The translators don't currently use the IRT, so there is no IRT cache
- // query for those two loads. The PNaCl main nexe comes from a
- // delete-on-close temp file, so it doesn't have a stable identity
- // for validation caching. All three query results should be misses.
- histograms.ExpectUniqueSample("NaCl.ValidationCache.Query",
- nacl::NaClBrowser::CACHE_MISS, 3);
- // Should have received a cache setting afterwards for IRT and translators.
+ // Should have received 4 validation queries:
+ // - Two for the IRT: the app and one of the translator nexes use the IRT.
+ // - Two for the two PNaCl translator nexes.
+ // The PNaCl app nexe comes from a delete-on-close temp file, so it
+ // doesn't have a stable identity for validation caching. Overall, there
+ // are 3 eligible nexes. The first 3 queries for these eligible nexes
+ // are misses, and one of the IRT queries is a hit.
+ histograms.ExpectBucketCount("NaCl.ValidationCache.Query",
+ nacl::NaClBrowser::CACHE_MISS, 3);
+ histograms.ExpectBucketCount("NaCl.ValidationCache.Query",
+ nacl::NaClBrowser::CACHE_HIT, 1);
+ // Should have received a cache setting afterwards.
histograms.ExpectUniqueSample("NaCl.ValidationCache.Set",
nacl::NaClBrowser::CACHE_HIT, 3);
// cache hits!)
RunLoadTest(FILE_PATH_LITERAL("pnacl_options.html?use_nmf=o_2"));
- // Should now have 3 more queries on top of the previous ones.
- histograms.ExpectTotalCount("NaCl.ValidationCache.Query", 6);
- // With the 3 extra queries being cache hits.
+ // Should now have 4 more queries on top of the previous ones.
+ histograms.ExpectTotalCount("NaCl.ValidationCache.Query", 8);
+ // With the extra queries being cache hits.
histograms.ExpectBucketCount("NaCl.ValidationCache.Query",
- nacl::NaClBrowser::CACHE_HIT, 3);
+ nacl::NaClBrowser::CACHE_HIT, 5);
// No extra cache settings.
histograms.ExpectUniqueSample("NaCl.ValidationCache.Set",
- nacl::NaClBrowser::CACHE_HIT, 3);
+ nacl::NaClBrowser::CACHE_HIT, 3);
}