aboutsummaryrefslogtreecommitdiff
path: root/third_party/abseil-cpp/absl/base/internal/low_level_alloc_test.cc
diff options
context:
space:
mode:
authorAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2022-04-28 16:01:35 +0000
committerAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2022-04-28 16:01:35 +0000
commit2ce195a4ebcb305b9320436273d9d23c717ad6f4 (patch)
tree2ce94d7f0804ccb77d1fa9b2a1bca00eecdff1e2 /third_party/abseil-cpp/absl/base/internal/low_level_alloc_test.cc
parentcde6b2521fd8eb70e0fee633ec726ad687286c67 (diff)
parent7563023510bf04108a954596ea9393a4c11ac279 (diff)
downloadwebrtc-2ce195a4ebcb305b9320436273d9d23c717ad6f4.tar.gz
Snap for 8512216 from 7563023510bf04108a954596ea9393a4c11ac279 to tm-frc-media-swcodec-releaset_frc_swc_330443040t_frc_swc_330443010android13-frc-media-swcodec-release
Change-Id: I9b0c9de1523358ec00bf7c85bb225b8f5639364b
Diffstat (limited to 'third_party/abseil-cpp/absl/base/internal/low_level_alloc_test.cc')
-rw-r--r--third_party/abseil-cpp/absl/base/internal/low_level_alloc_test.cc23
1 files changed, 22 insertions, 1 deletions
diff --git a/third_party/abseil-cpp/absl/base/internal/low_level_alloc_test.cc b/third_party/abseil-cpp/absl/base/internal/low_level_alloc_test.cc
index 7abbbf9c59..31abb888a6 100644
--- a/third_party/abseil-cpp/absl/base/internal/low_level_alloc_test.cc
+++ b/third_party/abseil-cpp/absl/base/internal/low_level_alloc_test.cc
@@ -21,6 +21,12 @@
#include <unordered_map>
#include <utility>
+#ifdef __EMSCRIPTEN__
+#include <emscripten.h>
+#endif
+
+#include "absl/container/node_hash_map.h"
+
namespace absl {
ABSL_NAMESPACE_BEGIN
namespace base_internal {
@@ -75,7 +81,7 @@ static bool using_low_level_alloc = false;
// allocations and deallocations are reported via the MallocHook
// interface.
static void Test(bool use_new_arena, bool call_malloc_hook, int n) {
- typedef std::unordered_map<int, BlockDesc> AllocMap;
+ typedef absl::node_hash_map<int, BlockDesc> AllocMap;
AllocMap allocated;
AllocMap::iterator it;
BlockDesc block_desc;
@@ -156,5 +162,20 @@ ABSL_NAMESPACE_END
int main(int argc, char *argv[]) {
// The actual test runs in the global constructor of `before_main`.
printf("PASS\n");
+#ifdef __EMSCRIPTEN__
+ // clang-format off
+// This is JS here. Don't try to format it.
+ MAIN_THREAD_EM_ASM({
+ if (ENVIRONMENT_IS_WEB) {
+ if (typeof TEST_FINISH === 'function') {
+ TEST_FINISH($0);
+ } else {
+ console.error('Attempted to exit with status ' + $0);
+ console.error('But TEST_FINSIHED is not a function.');
+ }
+ }
+ }, 0);
+// clang-format on
+#endif
return 0;
}