OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "base/test/histogram_tester.h" | 5 #include "base/test/histogram_tester.h" |
6 #include "chrome/test/nacl/nacl_browsertest_util.h" | 6 #include "chrome/test/nacl/nacl_browsertest_util.h" |
7 #include "components/nacl/browser/nacl_browser.h" | 7 #include "components/nacl/browser/nacl_browser.h" |
8 #include "content/public/test/browser_test_utils.h" | 8 #include "content/public/test/browser_test_utils.h" |
9 #include "native_client/src/trusted/service_runtime/nacl_error_code.h" | 9 #include "native_client/src/trusted/service_runtime/nacl_error_code.h" |
10 #include "ppapi/c/private/ppb_nacl_private.h" | 10 #include "ppapi/c/private/ppb_nacl_private.h" |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 histograms.ExpectTotalCount("NaCl.Perf.PNaClLoadTime.TotalUncachedTime", 1); | 75 histograms.ExpectTotalCount("NaCl.Perf.PNaClLoadTime.TotalUncachedTime", 1); |
76 histograms.ExpectTotalCount( | 76 histograms.ExpectTotalCount( |
77 "NaCl.Perf.PNaClLoadTime.TotalUncachedKBPerSec", 1); | 77 "NaCl.Perf.PNaClLoadTime.TotalUncachedKBPerSec", 1); |
78 histograms.ExpectTotalCount("NaCl.Perf.PNaClCache.IsHit", 1); | 78 histograms.ExpectTotalCount("NaCl.Perf.PNaClCache.IsHit", 1); |
79 } | 79 } |
80 }) | 80 }) |
81 | 81 |
82 class NaClBrowserTestNewlibVcacheExtension: | 82 class NaClBrowserTestNewlibVcacheExtension: |
83 public NaClBrowserTestNewlibExtension { | 83 public NaClBrowserTestNewlibExtension { |
84 public: | 84 public: |
85 virtual base::FilePath::StringType Variant() OVERRIDE { | 85 virtual base::FilePath::StringType Variant() override { |
86 return FILE_PATH_LITERAL("extension_vcache_test/newlib"); | 86 return FILE_PATH_LITERAL("extension_vcache_test/newlib"); |
87 } | 87 } |
88 }; | 88 }; |
89 | 89 |
90 IN_PROC_BROWSER_TEST_F(NaClBrowserTestNewlibVcacheExtension, | 90 IN_PROC_BROWSER_TEST_F(NaClBrowserTestNewlibVcacheExtension, |
91 ValidationCacheOfMainNexe) { | 91 ValidationCacheOfMainNexe) { |
92 base::HistogramTester histograms; | 92 base::HistogramTester histograms; |
93 // Hardcoded extension AppID that corresponds to the hardcoded | 93 // Hardcoded extension AppID that corresponds to the hardcoded |
94 // public key in the manifest.json file. We need to load the extension | 94 // public key in the manifest.json file. We need to load the extension |
95 // nexe from the same origin, so we can't just try to load the extension | 95 // nexe from the same origin, so we can't just try to load the extension |
(...skipping 25 matching lines...) Expand all Loading... |
121 nacl::NaClBrowser::CACHE_HIT, 2); | 121 nacl::NaClBrowser::CACHE_HIT, 2); |
122 // TOTAL should then be 4 queries now. | 122 // TOTAL should then be 4 queries now. |
123 histograms.ExpectTotalCount("NaCl.ValidationCache.Query", 4); | 123 histograms.ExpectTotalCount("NaCl.ValidationCache.Query", 4); |
124 // Still only 2 settings. | 124 // Still only 2 settings. |
125 histograms.ExpectTotalCount("NaCl.ValidationCache.Set", 2); | 125 histograms.ExpectTotalCount("NaCl.ValidationCache.Set", 2); |
126 } | 126 } |
127 | 127 |
128 class NaClBrowserTestGLibcVcacheExtension: | 128 class NaClBrowserTestGLibcVcacheExtension: |
129 public NaClBrowserTestGLibcExtension { | 129 public NaClBrowserTestGLibcExtension { |
130 public: | 130 public: |
131 virtual base::FilePath::StringType Variant() OVERRIDE { | 131 virtual base::FilePath::StringType Variant() override { |
132 return FILE_PATH_LITERAL("extension_vcache_test/glibc"); | 132 return FILE_PATH_LITERAL("extension_vcache_test/glibc"); |
133 } | 133 } |
134 }; | 134 }; |
135 | 135 |
136 IN_PROC_BROWSER_TEST_F(NaClBrowserTestGLibcVcacheExtension, | 136 IN_PROC_BROWSER_TEST_F(NaClBrowserTestGLibcVcacheExtension, |
137 ValidationCacheOfMainNexe) { | 137 ValidationCacheOfMainNexe) { |
138 // Make sure histograms from child processes have been accumulated in the | 138 // Make sure histograms from child processes have been accumulated in the |
139 // browser process. | 139 // browser process. |
140 base::HistogramTester histograms; | 140 base::HistogramTester histograms; |
141 // Hardcoded extension AppID that corresponds to the hardcoded | 141 // Hardcoded extension AppID that corresponds to the hardcoded |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
209 // No extra cache settings. | 209 // No extra cache settings. |
210 histograms.ExpectUniqueSample("NaCl.ValidationCache.Set", | 210 histograms.ExpectUniqueSample("NaCl.ValidationCache.Set", |
211 nacl::NaClBrowser::CACHE_HIT, 3); | 211 nacl::NaClBrowser::CACHE_HIT, 3); |
212 } | 212 } |
213 | 213 |
214 | 214 |
215 // TODO(ncbray) convert the rest of nacl_uma.py (currently in the NaCl repo.) | 215 // TODO(ncbray) convert the rest of nacl_uma.py (currently in the NaCl repo.) |
216 // Test validation failures and crashes. | 216 // Test validation failures and crashes. |
217 | 217 |
218 } // namespace | 218 } // namespace |
OLD | NEW |